Skip to content

Add ToolAnnotations support to McpServer.tool() method #309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 22, 2025

Conversation

bhosmer-ant
Copy link
Contributor

Summary

  • Add support for ToolAnnotations in McpServer.tool() method according to MCP spec
  • Added new overloads to support all combinations of description, params, and annotations
  • Extended RegisteredTool type to include annotations
  • Updated ListTools handler to return annotations in responses
  • Added tests for all annotation scenarios
  • Updated examples to show tool annotations in action

Test plan

  • All existing tests pass
  • Added new tests for tool annotations functionality
  • Verified example code works with annotations
  • Full test suite passes with all new overloads

Copy link
Contributor

@ihrpr ihrpr left a comment

Choose a reason for hiding this comment

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

Looks good!

@bhosmer-ant bhosmer-ant force-pushed the basil/tool_annotations branch from 487013b to e53608e Compare April 22, 2025 20:37
@bhosmer-ant bhosmer-ant merged commit c04842e into main Apr 22, 2025
4 checks passed
@bhosmer-ant bhosmer-ant deleted the basil/tool_annotations branch April 22, 2025 20:40
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.

None yet

2 participants