Claude Advanced Tool Use
TL;DR Highlight
Deferring tool loading and calling tools via code cut tokens 85% and raised accuracy.
Who Should Read
An agent developer who connected many MCP servers and struggles with tool-definition token bloat and wrong tool selection.
Core Mechanics
- Tool definitions eat 55K tokens before work starts
- A five-server setup (GitHub, Slack, Sentry, Grafana, Splunk) with 58 tools takes about 55K tokens.
- Jira alone is about 17K tokens, and Anthropic saw 134K tokens of tool definitions before optimization.
- Tool Search Tool loads only needed tools
- Tools marked defer_loading: true stay out of context until a search expands them.
- Token usage dropped 85%, and prompt caching is not broken.
- On MCP evals, Opus 4 went 49%→74% and Opus 4.5 went 79.5%→88.1%.
- Programmatic Tool Calling runs tools through code
- Claude writes Python that calls multiple tools, and intermediate results stay out of the model's context.
- In the budget example, 200KB of raw data shrank to 1KB of results.
- Only tools with allowed_callers set to code execution can be called from code.
- PTC improves tokens and accuracy
- Average tokens on complex research tasks fell from 43,588 to 27,297, a 37% reduction.
- Internal knowledge retrieval went 25.6%→28.5% and GIA benchmarks 46.5%→51.2%.
- Batching 20+ tool calls in one code block removes 19+ inference passes.
- Tool Use Examples teach usage patterns
- JSON Schema can't express date formats, ID conventions, or when to use optional parameters.
- Adding input_examples to a tool definition raised complex-parameter accuracy from 72% to 90% in internal testing.
- Clear guidance on when to use each
- Tool Search pays off with over 10K tokens of definitions or 10+ tools, and helps less with fewer than 10 tools.
- PTC pays off with 3+ dependent calls or large data where only aggregates matter.
Community Reactions
- Building tool search yourself is easy
- One commenter built it by passing only a search tool in the first LLM call, then the returned tools in the second.
- Counterpoint: one tool may be enough
- A commenter said a single GraphQL tool with introspection avoids loading 50+ tools and worked better.
- Others argued that a shell tool and CLI --help are enough.
- Concern about recovering from mid-run failures in PTC
- Commenters said fixing a failure halfway through a multi-tool script is harder, especially with non-idempotent APIs.
- They suggested using it for idempotent, retryable tasks.
- Worries about debugging and ranking abuse
- A commenter said opaque tool search makes it hard to tell why the wrong tool was picked.
- Another expected tool makers to game search rankings as similar tools multiply.
How to Apply
- Measure your tool-definition tokens first
- Run your agent's full tools array through a token counter and check if it exceeds 10K.
- If it does, or you have 10+ tools, Tool Search is a candidate.
- Add defer_loading to rarely used tools
- Add a search tool (regex or BM25) to tools and keep only core tools at defer_loading: false.
- For MCP, defer the whole server via default_config in mcp_toolset and keep high-use tools loaded.
- Apply PTC to flows that aggregate large results
- Pick flows with 3+ dependent calls or large data needing only a summary, and set allowed_callers.
- Start with idempotent reads, and plan failure recovery before enabling writes.
- Add input_examples to confusing tools
- For tools with date formats, ID conventions, or nested objects, add 1-3 examples.
- Mix a fully filled example with a minimal one to show when optional fields apply.
Try It
# Paste into Claude or ChatGPT (the article's Tool Use Examples idea turned into a prompt)
Look at the JSON Schema of the tool below and first list ambiguities a model might hit (date format, ID conventions, when to fill nested objects, parameter correlations).
Then write 3 input_examples that resolve those ambiguities.
- Example 1: a typical complex case with all fields filled
- Example 2: a case with only some optional fields
- Example 3: a minimal case with required fields only
Output a JSON array I can paste straight into the tool definition.
Tool definition:
{{tool JSON Schema}}Terminology
Related Papers
Frostbite: A new CPU architecture discovered, designed and verified by AI
AI agents designed a CPU from scratch, claiming 4.59x perf/W over a traditional core
Restricting AI agents in mobile operating systems platforms from capturing data
Signal now blocks OS-level AI agents from reading its screen on iOS 27 and Android
Actions Speak Louder than Words: Stateful Privacy Sniffing of LLM Agents via Behavioral Covert Channels in Web Interactions
Agents' link choices alone let attackers rebuild user queries at F1 0.89; SOR cuts it to 0.39.
Tracking and Limiting Unsupported Claim Propagation in Multi-Agent LLM Systems: A Provenance-Aware Framework
Passing claims with source, evidence and history kept equivalence at 5 agent stages at 96% versus 31%.
LLM assisted reverse engineering
Pointing an agent at binaries with skills and MD notes made years-long hacks feasible
Metrics-in-the-Loop: Complexity Feedback Reshapes Agent-Written Code
Injecting per-turn complexity reports into coding agents cut code erosion without changing correctness
Why is Gemini 4 Carbon taking so long?
Carbon took nearly an hour on bug fixes that Astra and Opus finished in minutes, mostly from extra unrequested work.
Weight-Space Programming builds neural networks like a 1990s researcher
LLM hand-wrote MNIST weights to 91.3%, using 1990s-style techniques