Skip to content

Keep a tool's _meta, title, icons, and execution on the client - #641

Open
koic wants to merge 1 commit into
modelcontextprotocol:mainfrom
koic:keep_tool_meta_title_icons_and_execution_on_the_client
Open

koic wants to merge 1 commit into
modelcontextprotocol:mainfrom
koic:keep_tool_meta_title_icons_and_execution_on_the_client

Conversation

@koic

@koic koic commented Oct 30, 2026

Copy link
Copy Markdown
Member

Motivation and Context

MCP::Client#list_tools built each MCP::Client::Tool from name, description, inputSchema, outputSchema, and annotations, and dropped the other members of the specification's Tool object: title and _meta (2025-06-18) and icons and execution (2025-11-25). Extensions put what a host needs under _meta: MCP Apps (SEP-1865) names a tool's app under _meta.ui, so a host on this client could not tell which tools have an app without a second raw tools/list of its own (#640). The TypeScript and Python clients keep all four on their Tool types, and this SDK's own MCP::Tool already serves title, icons, and _meta.

MCP::Client::Tool now keeps the four as the server sent them, the way annotations is kept, behind title, icons, execution, and meta readers; list_tools passes them through, and a member a tool omits reads as nil. The SDK gives none of them a meaning of its own: execution carries the task-support hint of SEP-1686, which this SDK does not act on yet, and _meta keys belong to the extensions that define them.
The client page notes that all four are untrusted input from the server, which the SDK does not act on.

Closes #640.

How Has This Been Tested?

test/mcp/client/tool_test.rb and test/mcp/client_test.rb, which read the four members back from a tools/list answer carrying the MCP Apps _meta.ui shape and see nil when a tool omits them. At d518025 the readers raise NoMethodError and MCP::Client::Tool.new refuses the keywords.

Breaking Changes

None. The new keywords of MCP::Client::Tool#initialize default to nil.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

## Motivation and Context

`MCP::Client#list_tools` built each `MCP::Client::Tool` from `name`, `description`, `inputSchema`,
`outputSchema`, and `annotations`, and dropped the other members of the specification's `Tool` object:
`title` and `_meta` (2025-06-18) and `icons` and `execution` (2025-11-25). Extensions put what a host needs
under `_meta`: MCP Apps (SEP-1865) names a tool's app under `_meta.ui`, so a host on this client could not
tell which tools have an app without a second raw `tools/list` of its own (modelcontextprotocol#640). The TypeScript and Python
clients keep all four on their `Tool` types, and this SDK's own `MCP::Tool` already serves `title`, `icons`,
and `_meta`.

`MCP::Client::Tool` now keeps the four as the server sent them, the way `annotations` is kept, behind
`title`, `icons`, `execution`, and `meta` readers; `list_tools` passes them through, and a member a tool
omits reads as nil. The SDK gives none of them a meaning of its own: `execution` carries the task-support
hint of SEP-1686, which this SDK does not act on yet, and `_meta` keys belong to the extensions that define
them.
The client page notes that all four are untrusted input from the server, which the SDK does not act on.

Closes modelcontextprotocol#640.

## How Has This Been Tested?

test/mcp/client/tool_test.rb and test/mcp/client_test.rb, which read the four members back from a `tools/list`
answer carrying the MCP Apps `_meta.ui` shape and see nil when a tool omits them. At d518025 the readers raise
`NoMethodError` and `MCP::Client::Tool.new` refuses the keywords.

## Breaking Changes

None. The new keywords of `MCP::Client::Tool#initialize` default to nil.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Client::Tool drops a tool's _meta from tools/list (MCP Apps' _meta.ui is unreachable through Client#tools)

2 participants