Fix: Add missing MCP SDK discovery attributes to PivotTable tool #156
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.
Summary
excel_pivottabletool was invisible to LLMs despite complete implementation. Missing[McpServerToolType]class attribute and explicit tool name prevented MCP SDK'sWithToolsFromAssembly()discovery.Type of Change
Related Issues
Closes #[issue number per problem statement]
Changes Made
ExcelPivotTableTool.cs (2 lines):
[McpServerToolType]to class - required for SDK assembly scanningName = "excel_pivottable"to[McpServerTool]attributeToolDiscoveryTests.cs (new file, 24 tests):
[McpServerToolType]class attribute[McpServerTool(Name = "...")]with correct naming conventionPattern comparison:
Testing Performed
Test Commands
Screenshots (if applicable)
N/A - attribute-only fix with no UI changes
Core Commands Coverage Checklist⚠️
Does this PR add or modify Core Commands methods? [x] No
Core implementation already existed and was complete. Only MCP SDK discovery attributes were missing.
Checklist
ExcelHelper.WithExcel()for Excel operations.EscapeMarkup()Additional Notes
Documentation already listed
excel_pivottableas tool #6 of 11 - only discovery mechanism was broken. Zero functional changes to PivotTable implementation itself.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.