In short.
Anthropic's Tool runner guide is documentation for developers connecting Claude to application functions, but its beta helpers differ across languages and the page recommends a manual loop when human approval is needed. It explains how the SDK executes requested tools and returns their results, with examples in Python, TypeScript, C#, Go, Java, PHP and Ruby. Particularly useful details include validation differences, conversation-history ownership and a C# duplicate-execution hazard. Installation requirements, total costs, licensing and actual runtime reliability are not established.
Researched and written by an AI model and checked by a second AI model. How it works
Covers the complete supplied documentation page at [https://platform.claude.com/docs/en/agents-and-tools/tool-use/tool-runner.md], including all seven language examples, state ownership, compaction, debugging, error interception, result modification, streaming and availability notices. Linked SDK repositories, implementation files and related documentation pages are excluded. The snapshot was captured at 2026-11-15T00:15:55.612Z. Nothing was executed; installation, API compatibility, runtime behavior, performance and costs remain unverified.
The overview
Identity
Tool runner (SDK) is Anthropic's documentation for SDK helpers that execute functions requested by Claude and manage the resulting conversation. The resource is a guide to an SDK feature. Original source: [https://platform.claude.com/docs/en/agents-and-tools/tool-use/tool-runner.md].
The page provides examples for Python, TypeScript, C#, Go, Java, PHP and Ruby, and labels the feature beta.
Assessment
This is useful for developers who want to replace repetitive code for sending tool calls, executing functions and returning results. It covers both a basic integration and the less obvious behavior that matters when changing request parameters or conversation history.
Its usefulness depends on the chosen SDK. Validation, streaming, error inspection and state changes do not have identical behavior across languages. The page supports an assessment of documented capabilities; reliability, performance and production suitability were not assessed.
Users
The guide suits application developers adding calculations, document searches, service lookups or other functions that Claude can request. Beginners get concrete examples, but still need to understand functions, API requests and their programming language's SDK.
Experienced developers will find the most consequential material in state ownership, error handling and result modification. For applications requiring human approval, custom logging or conditional execution, the page recommends implementing a manual tool loop.
Capabilities
The runner executes registered tools when Claude requests them, sends results back and maintains conversation state. Depending on the SDK, tool results can be strings or text, image and document content blocks. To return structured data, such as a JSON object or a number, the page says to encode it as a string first; a returned string becomes a single text content block.
The guide also covers intermediate messages, final-message helpers, iteration limits, request changes, conversation compaction, exception handling and caching metadata. Streaming is documented for six SDKs; PHP tool-runner streaming is explicitly unavailable.
A separate availability note describes session tool runners for Managed Agents in Python, TypeScript and Go. In that arrangement, the session itself runs the agent loop.
Using it
Requirements
An integration needs the relevant Anthropic SDK, access to the selected model and API platform, and application functions implementing the tools. Complete installation, authentication and account setup instructions are not provided. Minimum SDK and language-runtime versions are unknown from this page.
TypeScript's betaZodTool helper requires Zod 3.25.0 or higher. Its JSON Schema alternative, betaTool, does not validate Claude's generated input at runtime; validation must be implemented inside the handler if required.
The availability section lists beta Messages API support across supported platforms. Managed Agents session-tool support is listed specifically for Claude API and Claude Platform on AWS.
Mechanism
The basic cycle sends the current conversation to the Messages API, receives Claude's response, executes any requested tools and returns their results on the next request. The runner stops when a response contains no tool calls or an explicitly configured iteration limit is reached. Iteration also exposes responses to application code.
Tool definitions vary by SDK. Python derives schemas from type hints and docstrings; Go uses input structs and schema tags; Java derives schemas and parsing from annotated classes and marks tools strict; Ruby uses typed models. C# and PHP examples pair explicit schemas with handlers.
Taking over conversation history changes who must preserve valid assistant messages and matching tool results. The guide's language-specific sections are essential because state changes do not suppress automatic appending consistently across SDKs.
Setup
The documented starting sequence is to initialize a client, define tools with descriptions and input schemas, then create a runner with a model, response-token budget, tools and initial messages. In Python, tools use the beta_tool decorator; with the async client, the page says to use beta_async_tool instead and define the function with async def.
Consume intermediate messages or use the language's completion helper. Python offers until_done(), TypeScript supports awaiting the runner, and Java requires iterating to exhaustion and retaining the last message. An explicit max_iterations setting, or its language equivalent, bounds the loop.
For threshold-based compaction, the page specifies a compact_20260112 context-management entry and the compact-2026-01-12 beta header, which the runner does not add automatically. On-demand compaction uses a separate helper and cannot coexist with that entry on the same runner.
Example
The Python example registers get_weather and calculate_sum, then asks Claude for Paris weather and the sum of 15 and 27. The runner is responsible for executing requested functions and sending their results back.
The weather function returns fixed sunny-weather JSON; it does not retrieve current weather or use its location and unit arguments. The arithmetic function returns the sum as a string. These examples illustrate tool wiring. Nothing was executed, so successful completion and actual model responses are unverified.
Assessment & evidence
Limitations
State mutation is a major portability trap. Python can change request parameters without taking over history. TypeScript parameter setters and Java's setNextParams() suppress automatic appending for that turn. Go always appends assistant messages and tool results. Ruby's next_message returns after those entries have already been appended.
C# still executes matching tools after state takeover and discards its automatically built results. Manually executing the same tool in the loop can therefore execute it twice. This matters especially for functions that change external state.
Error and result hooks also differ. C#, Go, Java and PHP offer no hook to inspect tool errors before they are sent to Claude; Ruby users read the last entry of runner.params[:messages] instead. C# does not support modifying tool results at all. Go and Java can set cache_control only on the inner content blocks a tool returns, not on the outer tool_result block. PHP has no mutation callback, so users build the result themselves and push it with pushMessages(). Outside Python, failed tools are not automatically logged. PHP streaming is unavailable, and runtime validation is not universal.
Reasoning
The helper's strongest fit is an application where Claude may execute registered functions automatically and default conversation management is sufficient. In that setting, the documented runner removes repeated orchestration work while allowing intermediate responses to be inspected.
The tradeoff is that advanced control depends on SDK-specific behavior. A schema or typed function signature alone does not establish runtime validation, approval handling or safe retries. Exception messages are returned to Claude, and some SDK logging includes request and response details, so error and logging content deserve deliberate design.
Alternatives
The page's main alternative is a manual tool loop, recommended when human approval, custom logging or conditional execution is required. That approach gives application code responsibility for tool_use parsing, execution and tool_result messages. The linked guide is [https://platform.claude.com/docs/en/agents-and-tools/tool-use/handle-tool-calls]; its contents are not established here.
Within TypeScript, betaZodTool provides Zod validation, while betaTool accepts JSON Schema and leaves runtime validation to the handler. No comparative evidence about third-party orchestration frameworks is provided.
Evidence
Anthropic's page provides primary documentation of intended behavior, with examples across seven languages and explicit qualifications about state control, errors, compaction and streaming. The original document is [https://platform.claude.com/docs/en/agents-and-tools/tool-use/tool-runner.md].
Documentation examples do not establish measured correctness, latency, cost or production reliability. Nothing was executed. Linked implementation files, related guides and external service behavior are outside the available evidence.
Access & freshness
Costs
The page gives no model token rates, tool-runner fee, compaction pricing or external-service charges. Total cost is unknown, and the absence of a listed fee does not establish that use is free.
The documented loop can make multiple model requests, including retries when application code changes parameters. An iteration limit bounds turns, but the page does not establish a monetary spending cap or provide measured cost examples.
Rights
The page does not supply a documentation license, code-example license or explicit redistribution permission. Rights to reuse or redistribute its text and examples are unknown from this evidence.
Links to SDK repositories do not establish those repositories' license terms. API service terms and rights relating to data processed by application tools are also not established here.
Freshness
The available page snapshot was captured on 15 November 2026 at 00:15:55 UTC. It labels the feature beta, but provides no publication date, last-updated date or compatible SDK release numbers.
The examples use the model identifier claude-opus-5-5. Whether those examples match a particular installed SDK, account or provider configuration is unverified. Changes after the snapshot are unknown.
Actions
Before adopting the helper, confirm the SDK version and provider support for the intended model. Start with a simple calculation tool, configure an iteration limit and verify input validation, error handling and completion behavior in the chosen language.
Check state-mutation behavior before implementing retries or custom tool results, especially C#'s duplicate-execution risk. Use the manual-loop guidance when human approval is required. Confirm pricing and applicable licenses separately because this page does not establish either.
