Add _meta to tool definitions#534
Merged
jokemanfire merged 1 commit intomodelcontextprotocol:mainfrom Nov 11, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for the _meta field to Tool definitions in accordance with the MCP specification. This is a breaking change that requires updating all Tool construction sites.
Key Changes:
- Added
meta: Option<Meta>field to the Tool struct with proper serialization as_meta - Updated tool macros to support the new
metaattribute in#[tool]annotations - Modified all existing Tool constructors and examples to include
meta: None
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
crates/rmcp/src/model/tool.rs |
Added meta field to Tool struct with proper serde rename to _meta and updated constructor |
crates/rmcp-macros/src/tool.rs |
Extended tool macro to parse and generate code for the new meta attribute |
examples/servers/src/sampling_stdio.rs |
Updated Tool construction to include meta: None field |
crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema_current.json |
Added _meta property definition to Tool schema |
crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema.json |
Added _meta property definition to Tool schema |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jokemanfire
approved these changes
Nov 11, 2025
03040f8
into
modelcontextprotocol:main
16 of 17 checks passed
This was referenced Nov 11, 2025
Merged
Merged
takumi-earth
pushed a commit
to earthlings-dev/rmcp
that referenced
this pull request
Jan 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds support for the _meta field to Tools.
Motivation and Contex
Closes #505
How Has This Been Tested?
Set this field in a local MCP server and verified I could see it in mcp inspector.
Breaking Changes
Anyone who was constructing a Tool like
Tool { fields, here}will now need to specify themetafield as well.Types of changes
Checklist
Additional context