-
Couldn't load subscription status.
- Fork 77
Add support for _meta field on tool schema #124
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
Add support for _meta field on tool schema #124
Conversation
0f5b460 to
3127bb6
Compare
|
I really need this! Looking forward to seeing this. |
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.
can you please update the name to meta to closely match the field's name in the spec?
LGTM otherwise, thanks @tuntisz!
Co-authored-by: Ateş Göral <ates@magnetiq.com>
Co-authored-by: Ateş Göral <ates@magnetiq.com>
Co-authored-by: Ateş Göral <ates@magnetiq.com>
Motivation and Context
This PR adds support for the
_metaproperty in tool definitions, bringing the Ruby SDK to feature parity with the TypeScript SDK and other official MCP implementations. Previously, Ruby-based MCP servers couldn't attach metadata to tools, limiting interoperability with protocol extensions that rely on this standard field. Resolves issue #123 .How Has This Been Tested?
test/mcp/tool_test.rbdefinemethod approaches_metaappears correctly in tool serialization fortools/listresponses_metafield. Screenshot belowBreaking Changes
None. The
metadataparameter is optional and existing code continues to work unchanged.Types of changes
Checklist
Additional context
The implementation follows the MCP specification exactly:
_metain the serialized tool schema (matching the spec)metadatafor consistency with other SDK methodsdefinemethod approaches are supportedExample usage: