From 1b4d9ab54b2dd7d0c204ead3a2e4b37c6766f291 Mon Sep 17 00:00:00 2001 From: Minh Vu Date: Thu, 25 Jun 2026 21:47:51 +0200 Subject: [PATCH] Fix MCP tool_runner docs examples --- helpers.md | 2 +- src/anthropic/lib/tools/mcp.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/helpers.md b/helpers.md index f24792ad..5e5e5dcd 100644 --- a/helpers.md +++ b/helpers.md @@ -162,7 +162,7 @@ async with stdio_client(StdioServerParameters(command="mcp-server")) as (read, w await mcp_client.initialize() tools_result = await mcp_client.list_tools() - runner = await client.beta.messages.tool_runner( + runner = client.beta.messages.tool_runner( model="claude-sonnet-4-20250514", max_tokens=1024, messages=[{"role": "user", "content": "Use the available tools"}], diff --git a/src/anthropic/lib/tools/mcp.py b/src/anthropic/lib/tools/mcp.py index faf2023d..408020cb 100644 --- a/src/anthropic/lib/tools/mcp.py +++ b/src/anthropic/lib/tools/mcp.py @@ -409,7 +409,7 @@ def async_mcp_tool( from anthropic.lib.tools.mcp import async_mcp_tool tools_result = await mcp_client.list_tools() - runner = await client.beta.messages.tool_runner( + runner = client.beta.messages.tool_runner( model="claude-sonnet-4-20250514", max_tokens=1024, tools=[async_mcp_tool(t, mcp_client) for t in tools_result.tools],