Skip to content

[dev-v5] fix(mcp): Add missing ListCategories and ListEnums MCP tools#4764

Open
AClerbois wants to merge 4 commits intomicrosoft:dev-v5from
AClerbois:users/aclerbois/dev-v5/improve-mcp-with-missing-methods
Open

[dev-v5] fix(mcp): Add missing ListCategories and ListEnums MCP tools#4764
AClerbois wants to merge 4 commits intomicrosoft:dev-v5from
AClerbois:users/aclerbois/dev-v5/improve-mcp-with-missing-methods

Conversation

@AClerbois
Copy link
Copy Markdown
Collaborator

Problem

When MCP tool methods returned empty or not-found results, the error messages suggested calling tools that did not exist:

  • ComponentListTools.cs"No components found in category '...'. Use ListCategories() to see available categories."tool did not exist
  • EnumTools.cs"Enum '...' not found. Use ListEnums() to see all available enums."tool did not exist

An AI agent receiving these suggestions could not act on them, making the guidance misleading and unhelpful.

Additionally, the README Tools table referenced ListDocumentationTopics instead of the actual C# method name ListDocumentation.

Changes

New MCP tools

Tool Class Description
ListCategories() ComponentListTools Lists all component categories with component counts. Enables the AI to discover valid category names for ListComponents(category: ...).
ListEnums() EnumTools Lists all enum types with their descriptions. Enables the AI to discover valid enum names for GetEnumValues(enumName: ...).

Documentation fix

  • README.md Tools table: corrected ListDocumentationTopicsListDocumentation, added ListCategories and ListEnums entries.

Tests

  • 4 new tests for ListCategories() in ComponentListToolsTests.cs
  • 4 new tests for ListEnums() in EnumToolsTests.cs
  • All 35 tests in the affected test files pass

Files changed

  • src/Tools/McpServer/Tools/ComponentListTools.cs
  • src/Tools/McpServer/Tools/EnumTools.cs
  • src/Tools/McpServer/README.md
  • tests/Tools/McpServer.Tests/Tools/ComponentListToolsTests.cs
  • tests/Tools/McpServer.Tests/Tools/EnumToolsTests.cs

Copilot AI review requested due to automatic review settings April 29, 2026 16:47
@AClerbois AClerbois changed the title fix(mcp): Add missing ListCategories and ListEnums MCP tools [dev-v5] fix(mcp): Add missing ListCategories and ListEnums MCP tools Apr 29, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the missing MCP tools referenced by existing error messages so AI agents can discover valid component categories and enum names, and aligns the MCP server README tool list with the actual tool surface.

Changes:

  • Added ListCategories() MCP tool to list component categories with counts.
  • Added ListEnums() MCP tool to list available enum types with descriptions.
  • Updated MCP server README tool table and added tests covering the new tools.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Tools/McpServer/Tools/ComponentListTools.cs Adds ListCategories() tool to enumerate categories (supports ListComponents(category: ...) discovery).
src/Tools/McpServer/Tools/EnumTools.cs Adds ListEnums() tool to enumerate enums (supports GetEnumValues(enumName: ...) discovery).
src/Tools/McpServer/README.md Fixes tool table entries and documents the new tools.
tests/Tools/McpServer.Tests/Tools/ComponentListToolsTests.cs Adds tests validating ListCategories() output/structure.
tests/Tools/McpServer.Tests/Tools/EnumToolsTests.cs Adds tests validating ListEnums() output/structure.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Tools/McpServer/Tools/ComponentListTools.cs
Comment thread src/Tools/McpServer/Tools/EnumTools.cs
AClerbois and others added 2 commits April 29, 2026 19:24
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@vnbaaij vnbaaij enabled auto-merge (squash) April 29, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants