Skip to content

Fix MCP async tool_runner docs#1707

Open
fallintoplace wants to merge 1 commit into
anthropics:mainfrom
fallintoplace:fix/mcp-tool-runner-docs
Open

Fix MCP async tool_runner docs#1707
fallintoplace wants to merge 1 commit into
anthropics:mainfrom
fallintoplace:fix/mcp-tool-runner-docs

Conversation

@fallintoplace

Copy link
Copy Markdown

Problem

Some MCP async examples show await on client.beta.messages.tool_runner(...), but tool_runner() returns an async iterator and is not awaitable.

Users who copy that pattern hit a runtime TypeError before entering the runner loop.

Fix

  • Remove the incorrect await in the MCP helpers guide example (helpers.md).
  • Remove the incorrect await from the async_mcp_tool() docstring example (src/anthropic/lib/tools/mcp.py).

Both examples now directly assign runner = client.beta.messages.tool_runner(...) and then iterate with async for.

Testing

Not run (docs-only change).

@fallintoplace fallintoplace requested a review from a team as a code owner June 25, 2026 19:48
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