Skip to content

Conversation

mat-octave
Copy link

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

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

2 participants