Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Advanced tool use patterns including tool search, programmatic calling, and production orchestration. Use when scaling to 10,000+ tools, optimizing token usage, or implementing production tool systems.
.claude/skills/majiayu000-claude-advanced-tool-use/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 26% | 0% |
| case-02 | ✗→✓ | ▲ Improved | -12% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 117% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 62% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 81% | 0% |
Advanced tool use provides three complementary features that address distinct bottlenecks in production systems. These features can be used independently or combined for compounding efficiency gains of 37-85%.
1. Tool Search (85-95% context savings)
2. Programmatic Tool Calling (37% token reduction)
3. Tool Use Examples (72% → 90% accuracy)
Key Insight: Start with your biggest bottleneck, then add complementary features as needed. Not all-or-nothing.
| Feature | Token Savings | Best For | Complexity | Beta Header | |---------|---------------|----------|------------|-------------| | Tool Search | 85-95% | Large tool sets (10+ tools) | Low | advanced-tool-use-2025-11-20 | | Programmatic Calling | 37% | Multi-step workflows (3+ dependent calls) | Medium | advanced-tool-use-2025-11-20 | | Tool Examples | Accuracy (72%→90%) | Complex parameters, optional fields | Low | N/A |
Tool Search:
Programmatic Calling:
Tool Use Examples:
Production Patterns:
Python Example:
pythonimport anthropic client = anthropic.Anthropic() tools = [ # Always-loaded: tool search itself { "type": "tool_search_tool_regex_20251119", "name": "tool_search_tool_regex" }, # Always-loaded: frequently used tools (3-5 total) { "name": "get_user_info", "description": "Get user information by ID", "input_schema": { "type": "object", "properties": { "user_id": {"type": "string"} } } }, # Deferred: specialized tools loaded on-demand { "name": "get_weather", "description": "Get current weather for a location", "input_schema": { "type": "object", "properties": { "location": {"type": "string"} } }, "defer_loading": True }, { "name": "get_forecast", "description": "Get weather forecast for a location and days ahead", "input_schema": { "type": "object", "properties": { "location": {"type": "string"}, "days": {"type": "integer"} } }, "defer_loading": True } ] response = client.beta.messages.create( model="claude-sonnet-4-5-20250929", betas=["advanced-tool-use-2025-11-20"], max_tokens=2048, messages=[{ "role": "user", "content": "What's the weather in San Francisco?" }], tools=tools ) print(response.content[0].text)
What Happens:
"weather"tool_reference blocks pointing to matching toolsget_weather with appropriate parametersWhen combined strategically, these features multiply efficiency gains:
Example: Large MCP System
Implementation Strategy:
From production codebase analysis (Source):
1. Planner + Executor
2. Preview Then Fetch
3. Guard + Act
4. Summarize Outputs
See references/production-patterns.md for complete implementation templates.
Identifying Your Bottleneck:
Optimization Checklist:
search_customer_orders not query_db)Tool search and programmatic calling work seamlessly with context editing:
Tool Result Clearing (from claude-context-management):
Programmatic Calling (keeps results out of context):
Combined Example:
pythonresponse = client.beta.messages.create( model="claude-opus-4-5-20251101", betas=["advanced-tool-use-2025-11-20", "context-management-2025-06-27"], tools=tools_with_deferred_loading, context_management={ "edits": [{ "type": "clear_tool_uses_20250919", "trigger": {"type": "input_tokens", "value": 100000}, "keep": {"type": "tool_uses", "value": 3} }] }, messages=messages )
For detailed implementation patterns, see:
references/tool-search-patterns.md: Complete tool search guide (regex + BM25 variants, deferred loading, MCP integration, 10K+ tool scalability)references/programmatic-tool-calling.md: Sandboxed execution patterns, allowed_callers parameter, token efficiency mechanisms, ideal use casesreferences/production-patterns.md: Architecture patterns from production codebases, security best practices, error handling, observabilityreferences/performance-optimization.md: Optimization strategies, caching patterns, latency reduction, efficiency metricsOther measured skills in the registry, with their headline benchmark lift.