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

main() — anthropic-sdk-python Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  5cdd6d40_f263_a4bd_dcef_6921cb4fa52f["main()"]
  fb1a4163_0002_aa33_791c_d193be58f7a1["tools_runner_search_tool.py"]
  5cdd6d40_f263_a4bd_dcef_6921cb4fa52f -->|defined in| fb1a4163_0002_aa33_791c_d193be58f7a1
  062634b0_7b8f_dd40_d7ec_abf487495482["make_tool_searcher()"]
  5cdd6d40_f263_a4bd_dcef_6921cb4fa52f -->|calls| 062634b0_7b8f_dd40_d7ec_abf487495482
  style 5cdd6d40_f263_a4bd_dcef_6921cb4fa52f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

examples/tools_runner_search_tool.py lines 64–77

def main() -> None:
    tools: list[BetaFunctionTool[Any]] = [
        get_weather,
        # ... many more tools
    ]
    runner = client.beta.messages.tool_runner(
        max_tokens=1024,
        model="claude-sonnet-4-5-20250929",
        tools=[*tools, make_tool_searcher(tools)],
        messages=[{"role": "user", "content": "What is the weather in SF?"}],
        betas=["tool-search-tool-2025-10-19"],
    )
    for message in runner:
        rich.print(message)

Subdomains

Frequently Asked Questions

What does main() do?
main() is a function in the anthropic-sdk-python codebase, defined in examples/tools_runner_search_tool.py.
Where is main() defined?
main() is defined in examples/tools_runner_search_tool.py at line 64.
What does main() call?
main() calls 1 function(s): make_tool_searcher.

Analyze Your Own Codebase

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

Try Supermodel Free