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.

Function python AnthropicClient SyncAPI calls 3 called by 1

Entity Profile

Dependency Diagram

graph TD
  22f51a8f_1741_b57a_a8ad_306e7f9091ae["tool_runner()"]
  8c902234_0aa5_f23d_186e_7c523acb8fed["Messages"]
  22f51a8f_1741_b57a_a8ad_306e7f9091ae -->|defined in| 8c902234_0aa5_f23d_186e_7c523acb8fed
  451c7d68_d5dc_be88_3b0d_c8e239fe9aae["tool_runner()"]
  451c7d68_d5dc_be88_3b0d_c8e239fe9aae -->|calls| 22f51a8f_1741_b57a_a8ad_306e7f9091ae
  451c7d68_d5dc_be88_3b0d_c8e239fe9aae["tool_runner()"]
  22f51a8f_1741_b57a_a8ad_306e7f9091ae -->|calls| 451c7d68_d5dc_be88_3b0d_c8e239fe9aae
  eedd35ac_a896_dc63_a3fe_c46cf577bffb["_validate_output_config_conflict()"]
  22f51a8f_1741_b57a_a8ad_306e7f9091ae -->|calls| eedd35ac_a896_dc63_a3fe_c46cf577bffb
  b3ae1af8_b549_4aef_c8c4_9309fd981a1a["_warn_output_format_deprecated()"]
  22f51a8f_1741_b57a_a8ad_306e7f9091ae -->|calls| b3ae1af8_b549_4aef_c8c4_9309fd981a1a
  style 22f51a8f_1741_b57a_a8ad_306e7f9091ae fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/anthropic/resources/beta/messages/messages.py lines 1244–1277

    def tool_runner(
        self,
        *,
        max_tokens: int,
        messages: Iterable[BetaMessageParam],
        model: ModelParam,
        tools: Iterable[BetaRunnableTool | BetaToolUnionParam],
        compaction_control: CompactionControl | Omit = omit,
        container: Optional[message_create_params.Container] | Omit = omit,
        context_management: Optional[BetaContextManagementConfigParam] | Omit = omit,
        inference_geo: Optional[str] | Omit = omit,
        max_iterations: int | 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,
    ) -> BetaToolRunner[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 1244.
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