Validate tool annotations value#122
Merged
atesgoral merged 1 commit intomodelcontextprotocol:mainfrom Sep 13, 2025
Merged
Conversation
e5db12d to
0f31211
Compare
atesgoral
reviewed
Sep 10, 2025
lib/mcp/server.rb
Outdated
| end | ||
| end | ||
| unless error_tool_names.empty? | ||
| message = "Error occurs in #{error_tool_names.join(", ")}. `annotations` supported by protocol version 2025-03-26 or higher" |
Tool annotations were introduced in the "2025-03-26" specification: > Added comprehensive tool annotations for better describing tool behavior, > like whether it is read-only or destructive (PR modelcontextprotocol/modelcontextprotocol#185) https://modelcontextprotocol.io/specification/2025-03-26/changelog#major-changes This means they are not supported in the "2024-11-05" specification, so validation errors will be raised for `protocol_version: "2024-11-05"`.
0f31211 to
0804828
Compare
atesgoral
approved these changes
Sep 11, 2025
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.
Motivation and Context
Tool annotations were introduced in the "2025-03-26" specification:
https://modelcontextprotocol.io/specification/2025-03-26/changelog#major-changes
This means they are not supported in the "2024-11-05" specification, so validation errors will be raised for
protocol_version: "2024-11-05".How Has This Been Tested?
Test code is being added.
Breaking Changes
The
protocol_version: "2024-11-05"which does not actually support Tool Annotations is specified and an exception occurs when Annotations is used. However this is regarded not as a breaking change but as the expected behavior in this PR. It is based on the same reasoning as the validation in #87.Types of changes
Checklist
Additional context