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.
60
71%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./skills/claude-advanced-tool-use/SKILL.mdAdvanced 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:
import 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:
response = 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 metrics93ed392
Also appears in
since Sep 12, 2026
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.