Uh oh!
There was an error while loading. Please reload this page.
Expose server tool annotations on MCP::Client::Tool - #445
Conversation
koic
commented
Jul 23, 2026
@rickreyhsig-wealthbox This looks good to me. Since I'll merge this after the v1.0 release (#470), could you remove the change entry to the CHANGELOG.md file that are currently causing the merge conflict? I can update the CHANGELOG.md as part of the release process. |
Uh oh!
There was an error while loading. Please reload this page.
rickreyhsig-wealthbox
commented
Jul 23, 2026
@koic I've removed the entry |
koic
commented
Jul 25, 2026
@rickreyhsig-wealthbox Could you squash your commits into one? |
Client#tools/#list_tools built Tool objects without an annotations field even though the server includes annotations in every tools/list response. Add the reader and pass the raw hash through, mirroring how output_schema is already handled.
60d070d to
3591acdComparerickreyhsig-wealthbox
commented
Jul 27, 2026
@koic done! |
Uh oh!
There was an error while loading. Please reload this page.
koic
commented
Jul 27, 2026
Thanks! |
Fixes#446
Summary
Client#tools/Client#list_toolssilently drop the server'sannotationsfield when building
MCP::Client::Toolobjects, even though the server sendsit in every
tools/listresponse (Tool#as_jsonincludesannotations: annotations_value&.to_h). Callers have no way to read a tool'sreadOnlyHint/destructiveHint/title/ etc. from the client side today— they have to bypass the public API and re-page
tools/listvia the private#requestmethod just to get at the raw definition.Change
MCP::Client::Toolgains anannotationsreader, populated the same way asthe existing
output_schema(optional kwarg, raw hash passed through asreceived on the wire — no reshaping into
MCP::Tool::Annotations, sincethat class's constructor expects snake_case keys and the wire format is
camelCase).
Client#list_toolspassesannotations: tool["annotations"]through whenconstructing each
Tool.Test plan
test/mcp/client/tool_test.rbandtest/mcp/client_test.rbcovering: annotations present, annotations absent(nil), and the full-parameters constructor case.
bundle exec rake test— 1270 runs, 0 failures.bundle exec rubocop— no offenses on changed files.