Allow Client#call_tool to accept a tool name#266
Merged
koic merged 1 commit intomodelcontextprotocol:mainfrom Mar 23, 2026
Merged
Conversation
## Motivation and Context `Client#call_tool` previously required an `MCP::Client::Tool` object to call a tool. This made the API harder to use compared to other MCP SDK implementations, which accept a tool name string directly: - Python SDK: `session.call_tool(name, arguments)` accepts a name string. https://github.com/modelcontextprotocol/python-sdk/blob/v1.26.0/src/mcp/client/session.py#L370 - TypeScript SDK: `client.callTool({ name, arguments })` accepts a name string. https://github.com/modelcontextprotocol/typescript-sdk/blob/ccb78f2/packages/client/src/client/client.ts#L834 ## How Has This Been Tested? Updated existing tests and added new tests. ## Breaking Change No. This change adds a `name:` parameter so callers can pass a tool name string directly without looking up a `Tool` object first. The existing `tool:` parameter continues to work for backward compatibility.
atesgoral
approved these changes
Mar 22, 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.
Motivation and Context
Client#call_toolpreviously required anMCP::Client::Toolobject to call a tool. This made the API harder to use compared to other MCP SDK implementations, which accept a tool name string directly:session.call_tool(name, arguments)accepts a name string. https://github.com/modelcontextprotocol/python-sdk/blob/v1.26.0/src/mcp/client/session.py#L370client.callTool({ name, arguments })accepts a name string. https://github.com/modelcontextprotocol/typescript-sdk/blob/ccb78f2/packages/client/src/client/client.ts#L834How Has This Been Tested?
Updated existing tests and added new tests.
Breaking Change
No. This change adds a
name:parameter so callers can pass a tool name string directly without looking up aToolobject first. The existingtool:parameter continues to work for backward compatibility.Types of changes
Checklist
Additional context