Claude Developer Platform Advanced Tool Use
Anthropic has released three new features for the Claude Developer Platform—Tool Search Tool, Programmatic Tool Calling, and Tool Use Examples—designed to allow AI agents to operate across massive tool libraries and complex datasets without exhausting the model's context window. These updates transition tool use from simple function calling to intelligent orchestration, reducing token overhead and improving execution accuracy.
Tool Search Tool: On-Demand Tool Discovery
The Tool Search Tool reduces context consumption by discovering tools on-demand rather than loading all definitions upfront. In environments with numerous Model Context Protocol (MCP) servers, tool definitions can consume over 100K tokens before a conversation begins, leading to "context bloat" and increased errors in tool selection.
Technical Implementation
Developers can mark tools with defer_loading: true to exclude them from the initial context. Claude is provided with the Tool Search Tool itself (and any critical tools marked defer_loading: false). When a specific capability is needed, Claude uses the search tool to find relevant references, which are then expanded into full definitions in the context.
Performance Gains
- Token Reduction: In a test case with 50+ MCP tools, context consumption dropped from ~77K tokens to ~8.7K tokens, an 85% reduction.
- Accuracy Improvements: Internal MCP evaluations showed significant gains: Opus 4 improved from 49% to 74%, and Opus 4.5 improved from 79.5% to 88.1%.
- Caching: Because deferred tools are excluded from the initial prompt, the system prompt and core tool definitions remain compatible with prompt caching.
Programmatic Tool Calling: Code-Based Orchestration
Programmatic Tool Calling allows Claude to orchestrate multiple tools via Python code in a sandboxed environment, preventing intermediate data from polluting the model's context. Traditional tool calling requires a full inference pass for every single invocation, and all raw results enter the context window, which is inefficient for large datasets.
How it Works
Instead of sequential natural language requests, Claude writes a Python script that calls multiple tools, processes the outputs (using loops, conditionals, and transformations), and returns only the final result to the model.
- Opt-in: Tools are marked with
allowed_callers: ["code_execution_20250825"]. - Execution: Claude generates a
server_tool_userequest containing Python code. - Processing: Tool results are processed within the Code Execution environment; the model does not see the raw intermediate data.
- Final Output: Only the final
stdoutof the script enters Claude's context.
Key Benefits
- Token Savings: Average usage dropped by 37% (from 43,588 to 27,297 tokens) on complex research tasks.
- Latency Reduction: By executing 20+ tool calls in one code block, the system eliminates 19+ unnecessary inference passes.
- Accuracy: Knowledge retrieval improved from 25.6% to 28.5%, and GIA benchmarks rose from 46.5% to 51.2%.
- Real-world Application: Claude for Excel utilizes this feature to modify spreadsheets with thousands of rows without overloading the context window.
Tool Use Examples: Improving Invocation Precision
Tool Use Examples provide a universal standard for demonstrating correct tool usage patterns that JSON schemas cannot express, such as formatting conventions and parameter correlations. While JSON schemas define structural validity, they cannot specify when to use optional parameters or the specific string formats an API expects.
Implementation and Impact
Developers can add an input_examples array to the tool definition containing sample tool calls. This teaches Claude:
- Format Conventions: e.g., using YYYY-MM-DD for dates or specific ID prefixes (e.g., "USR-12345").
- Nested Structures: How to correctly populate complex nested objects.
- Parameter Logic: Which combinations of optional parameters are appropriate for different scenarios (e.g., critical bugs requiring higher escalation levels).
Internal testing showed that providing examples improved accuracy from 72% to 90% for complex parameter handling.
Deployment Best Practices
Anthropic recommends layering these features based on the specific bottleneck of the agent:
| Bottleneck | Recommended Feature |
|---|---|
| Context bloat from tool definitions | Tool Search Tool |
| Large intermediate results polluting context | Programmatic Tool Calling |
| Parameter errors and malformed calls | Tool Use Examples |
Optimization Tips
- Discovery: Use clear, descriptive names and descriptions for tools to improve search accuracy. Keep 3-5 high-frequency tools always loaded while deferring the rest.
- Execution: Clearly document return formats in the tool description to help Claude write accurate Python parsing logic. Focus programmatic calling on idempotent operations and parallelizable tasks.
- Accuracy: Provide 1-5 realistic examples per tool, focusing on ambiguous areas where the schema is insufficient.
Sources
Related
- Dispatch
- Dispatch
- Dispatch
- Dispatch
- Project