Skip to content

feat: add toolAliases support to Python SDK#982

Open
nickovs wants to merge 1 commit into
anthropics:mainfrom
nickovs:nicko/add-tool-aliases
Open

feat: add toolAliases support to Python SDK#982
nickovs wants to merge 1 commit into
anthropics:mainfrom
nickovs:nicko/add-tool-aliases

Conversation

@nickovs
Copy link
Copy Markdown

@nickovs nickovs commented May 22, 2026

This PR addresses issue #980.

The code here adds the tool_aliases option to ClaudeAgentOptions, mirroring the TypeScript SDK's toolAliases feature. When set, the mapping is sent in the initialize control-protocol message so Claude routes built-in tool calls through the named MCP tools instead.

For example, tool_aliases={"Read": "mcp__fakefs__Read"} causes every built-in Read call to be handled by a custom in-process MCP server.

Tests are added to cover use of this with both the ClaudeSDKClient class and the query function. I also conducted end user testing to ensure that it functions as expected and the same as the TypeScript version.

Add the `tool_aliases` option to `ClaudeAgentOptions`, mirroring the
TypeScript SDK's `toolAliases` feature. When set, the mapping is sent
in the initialize control-protocol message so Claude routes built-in
tool calls through the named MCP tools instead.

For example, `tool_aliases={"Read": "mcp__fakefs__Read"}` causes every
built-in Read call to be handled by a custom in-process MCP server.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant