Skip to content

Conversation

@mat-octave
Copy link
Contributor

Adds a feature to add metadata to a tool using the FastMCP.tool decorator, passing it to the Tool object.

Motivation and Context

ChatGPT's App SDK expects information about UI resources to be in a tool's _meta field. The decorator FastMCP.tool didn'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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

mat-octave and others added 3 commits October 14, 2025 11:47
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.
Copy link
Contributor

@maxisbey maxisbey left a 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 maxisbey enabled auto-merge (squash) October 17, 2025 11:15
@maxisbey maxisbey merged commit 98f8248 into modelcontextprotocol:main Oct 17, 2025
18 checks passed
@saqadri
Copy link
Contributor

saqadri commented Oct 21, 2025

@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!

@felixweinberger
Copy link
Contributor

@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

@saqadri
Copy link
Contributor

saqadri commented Oct 21, 2025

@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!

@juanlarrambebere
Copy link

Hi! Very eager to try this release as well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs maintainer action Potentially serious issue - needs proactive fix and maintainer attention

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Availability of the meta parameter in tool definition on the server

5 participants