Home / Function/ tool_runner() — anthropic-sdk-python Function Reference

tool_runner() — anthropic-sdk-python Function Reference

Architecture documentation for the tool_runner() function in messages.py from the anthropic-sdk-python codebase.

Entity Profile

Dependency Diagram

graph TD
  719041a2_72f9_677d_7ac4_0d4ac0864217["tool_runner()"]
  8775b2c5_9ae8_617a_a34f_50ebeb30f473["AsyncMessages"]
  719041a2_72f9_677d_7ac4_0d4ac0864217 -->|defined in| 8775b2c5_9ae8_617a_a34f_50ebeb30f473
  ab3bcdbf_68bb_58dc_9548_4c7df5001a66["tool_runner()"]
  ab3bcdbf_68bb_58dc_9548_4c7df5001a66 -->|calls| 719041a2_72f9_677d_7ac4_0d4ac0864217
  ab3bcdbf_68bb_58dc_9548_4c7df5001a66["tool_runner()"]
  719041a2_72f9_677d_7ac4_0d4ac0864217 -->|calls| ab3bcdbf_68bb_58dc_9548_4c7df5001a66
  0c9b1599_7213_934e_163d_ece9cfb5dd05["_validate_output_config_conflict()"]
  719041a2_72f9_677d_7ac4_0d4ac0864217 -->|calls| 0c9b1599_7213_934e_163d_ece9cfb5dd05
  81d9bd1e_33f6_8aec_a331_9a50e9807905["_warn_output_format_deprecated()"]
  719041a2_72f9_677d_7ac4_0d4ac0864217 -->|calls| 81d9bd1e_33f6_8aec_a331_9a50e9807905
  style 719041a2_72f9_677d_7ac4_0d4ac0864217 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/anthropic/resources/beta/messages/messages.py lines 3025–3058

    def tool_runner(
        self,
        *,
        max_tokens: int,
        messages: Iterable[BetaMessageParam],
        model: ModelParam,
        tools: Iterable[BetaAsyncRunnableTool | BetaToolUnionParam],
        compaction_control: CompactionControl | Omit = omit,
        max_iterations: int | Omit = omit,
        container: Optional[message_create_params.Container] | Omit = omit,
        context_management: Optional[BetaContextManagementConfigParam] | Omit = omit,
        inference_geo: Optional[str] | Omit = omit,
        mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | Omit = omit,
        metadata: BetaMetadataParam | Omit = omit,
        output_config: BetaOutputConfigParam | Omit = omit,
        output_format: Optional[type[ResponseFormatT]] | Omit = omit,
        service_tier: Literal["auto", "standard_only"] | Omit = omit,
        speed: Optional[Literal["standard", "fast"]] | Omit = omit,
        stop_sequences: SequenceNotStr[str] | Omit = omit,
        stream: Literal[False] | Omit = omit,
        system: Union[str, Iterable[BetaTextBlockParam]] | Omit = omit,
        temperature: float | Omit = omit,
        top_k: int | Omit = omit,
        top_p: float | Omit = omit,
        thinking: BetaThinkingConfigParam | Omit = omit,
        tool_choice: BetaToolChoiceParam | Omit = omit,
        betas: List[AnthropicBetaParam] | Omit = omit,
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
    ) -> BetaAsyncToolRunner[ResponseFormatT]: ...

Subdomains

Called By

Frequently Asked Questions

What does tool_runner() do?
tool_runner() is a function in the anthropic-sdk-python codebase, defined in src/anthropic/resources/beta/messages/messages.py.
Where is tool_runner() defined?
tool_runner() is defined in src/anthropic/resources/beta/messages/messages.py at line 3025.
What does tool_runner() call?
tool_runner() calls 3 function(s): _validate_output_config_conflict, _warn_output_format_deprecated, tool_runner.
What calls tool_runner()?
tool_runner() is called by 1 function(s): tool_runner.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free