-
Couldn't load subscription status.
- Fork 2.7k
feat: add tool metadata in FastMCP.tool decorator #1463
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
Conversation
This reverts commit 88bc72d.
Add tests covering: - Adding metadata via ToolManager.add_tool() - Adding metadata via FastMCP.tool() decorator - Metadata preservation in Tool objects - Metadata inclusion in MCPTool when listing tools - Edge cases (None, empty dict, complex nested structures) - Integration with tool annotations All tests verify that the meta parameter correctly flows through the tool registration and listing pipeline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the submission @mat-octave ! I've gone ahead and pushed a unit test to your branch as well so we can get this merged :)
|
@maxisbey can we get a minor bump for the package published to pypi with these changes? Thank you! And thanks @mat-octave for fixing this! |
We generally do releases on Thursdays, so this will be in there on 10/23 |
Perfect, thank you @felixweinberger! |
|
Hi! Very eager to try this release as well! |
Adds a feature to add metadata to a tool using the
FastMCP.tooldecorator, passing it to the Tool object.Motivation and Context
ChatGPT's App SDK expects information about UI resources to be in a tool's
_metafield. The decoratorFastMCP.tooldidn't accept metadata but the field exists on the lower-level mcp.Tool object.How Has This Been Tested?
I added metadata to
mcp.tool(...)and started the server successfully. I used the Model Inspector to list the tools, and the metadata was visible in the schema.Breaking Changes
No, this just adds an optional field
meta.Types of changes
Checklist
Additional context