[dev-v5] fix(mcp): Add missing ListCategories and ListEnums MCP tools#4764
Open
AClerbois wants to merge 4 commits intomicrosoft:dev-v5from
Open
[dev-v5] fix(mcp): Add missing ListCategories and ListEnums MCP tools#4764AClerbois wants to merge 4 commits intomicrosoft:dev-v5from
AClerbois wants to merge 4 commits intomicrosoft:dev-v5from
Conversation
Contributor
There was a problem hiding this comment.
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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
vnbaaij
approved these changes
Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 existEnumTools.cs→"Enum '...' not found. Use ListEnums() to see all available enums."— tool did not existAn AI agent receiving these suggestions could not act on them, making the guidance misleading and unhelpful.
Additionally, the README Tools table referenced
ListDocumentationTopicsinstead of the actual C# method nameListDocumentation.Changes
New MCP tools
ListCategories()ComponentListToolsListComponents(category: ...).ListEnums()EnumToolsGetEnumValues(enumName: ...).Documentation fix
README.mdTools table: correctedListDocumentationTopics→ListDocumentation, addedListCategoriesandListEnumsentries.Tests
ListCategories()inComponentListToolsTests.csListEnums()inEnumToolsTests.csFiles changed
src/Tools/McpServer/Tools/ComponentListTools.cssrc/Tools/McpServer/Tools/EnumTools.cssrc/Tools/McpServer/README.mdtests/Tools/McpServer.Tests/Tools/ComponentListToolsTests.cstests/Tools/McpServer.Tests/Tools/EnumToolsTests.cs