Skip to content

MCP::Client::Tool silently drops the server's annotations field #446

Description

@rickreyhsig-wealthbox

Bug report

Client#tools / Client#list_tools build MCP::Client::Tool objects from
the tools/list response but only pass through name, description,
input_schema, and output_schema — the server's annotations field
(readOnlyHint, destructiveHint, idempotentHint, openWorldHint,
title) is silently dropped even though it's present on the wire.

Reproduction

Register a tool with annotations on the server:

server.define_tool(name: "delete_thing", annotations: { destructive_hint: true, title: "Delete Thing" }) { ... }

Then fetch it from a client:

client.tools.first.annotations
# => NoMethodError: undefined method `annotations'

MCP::Client::Tool has no annotations reader at all, and
Client#list_tools never reads tool["annotations"] out of the raw
response — even though the server always serializes it
(Tool#as_json includes annotations: annotations_value&.to_h).

Impact

There's no way to inspect a tool's annotations from the client side without
bypassing the public API and re-implementing pagination against the private
#request method to get at the raw tools/list response.

Fix

Opened #445 — adds an annotations reader to MCP::Client::Tool (populated
the same way as the existing output_schema) and passes tool["annotations"]
through in Client#list_tools.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions