AI Hub

AI Hub

11
Articles
107
Models
75
Agents
Insights
Insights 6 min read 37 views

Advanced Tool Use with Claude: Three Techniques for Better Agents

Tool Search, Programmatic Calling, and Usage Examples

Anthropic introduces three beta features for intelligent tool orchestration: Tool Search Tool, Programmatic Tool Calling, and Tool Use Examples. Learn how to reduce tokens by 85% and improve accuracy to 90%.

b
b3 Team
December 12, 2025
#Claude#Anthropic#Tool Use#Agents#Tutorial#Deep Dive

Anthropic has released three beta features for intelligent tool orchestration with Claude, addressing the core challenges of building effective AI agents: context management, latency, and accuracy.

The Three Features

1. Tool Search Tool

Problem: Loading hundreds of tool definitions bloats context and wastes tokens. Solution: Discover tools dynamically using defer_loading: true.
python{

"name": "get_weather",

"description": "Get current weather for a location",

"defer_loading": true # Tool discovered on-demand

}

Result: 85% reduction in token consumption while maintaining access to full tool libraries. Best Practice: Keep 3-5 most-used tools always loaded; defer the rest. Use clear, descriptive tool names for accurate discovery.

2. Programmatic Tool Calling

Problem: Multi-step workflows require many inference passes, creating latency. Solution: Let Claude write Python code that orchestrates multiple tools in a single execution.
python# Claude generates code like this:

results = []

for city in ["NYC", "LA", "Chicago"]:

weather = get_weather(city)

results.append(weather)

return aggregate(results)

Result: "When Claude orchestrates 20+ tool calls in a single code block, you eliminate 19+ inference passes." Best Practice: Mark tools with allowed_callers: ["code_execution_20250825"] and document return formats explicitly.

3. Tool Use Examples

Problem: Complex parameter formats lead to errors. Solution: Provide concrete usage patterns through input_examples.
python{

"name": "search_database",

"input_examples": [

{"query": "recent orders", "limit": 10},

{"query": "user:123", "include_deleted": true}

]

}

Result: Accuracy improved from 72% to 90% on complex parameter handling. Best Practice: Include 1-5 realistic examples per tool showing minimal, partial, and full specification patterns.

Choosing the Right Feature

Bottleneck
Solution
Context bloatTool Search Tool
Large intermediate resultsProgrammatic Tool Calling
Parameter errorsTool Use Examples
3 items

Performance Improvements

Metric
Before
After
Token usage43,58827,297 (37% reduction)
Knowledge retrieval25.6%28.5%
GIA benchmarks46.5%51.2%
3 items

Implementation

Enable with the beta flag:

pythonclient.beta.messages.create(

betas=["advanced-tool-use-2025-11-20"],

model="claude-sonnet-4-5-20250929",

tools=[

{"type": "tool_search_tool_regex_20251119"},

{"type": "code_execution_20250825"},

# Your tools with defer_loading, allowed_callers, input_examples

]

)

Key Takeaways

  1. 1.Layer features strategically - Don't enable everything; choose based on your bottleneck
  2. 2.Start with Tool Use Examples - Easiest to implement, immediate accuracy gains
  3. 3.Add Tool Search for scale - When you have 10+ tools
  4. 4.Use Programmatic Calling for workflows - When you need multi-step orchestration
These features represent a significant step toward more efficient, accurate AI agents that can handle complex real-world tasks.


Source: Anthropic Engineering Blog
Found this helpful? Share it with others!

Related Articles