[FEATURE] Support for Anthropic advanced tool use
Problem Statement
Problem Statement
Support for Anthropic's advanced tool use features released in November 2024. These features enable agents to work with large tool libraries more efficiently and handle complex workflows that aren't feasible with traditional tool calling patterns.
capabilities:
- Tool Search Tool: Allows agents to discover and load tools on-demand instead of loading all tool definitions upfront, reducing token consumption by up to 85%
- Programmatic Tool Calling: Enables agents to orchestrate tools through code execution, keeping intermediate results out of context and reducing latency
- Tool Use Examples: Provides a standard way to demonstrate correct tool usage patterns beyond JSON schema definitions
Proposed Solution
Add support for Anthropic's advanced tool use beta features to the SDK:
- Implement Tool Search Tool support with
defer_loadingparameter for tool definitions - Add Programmatic Tool Calling with
allowed_callersconfiguration for code execution integration - Support
input_examplesfield in tool definitions for Tool Use Examples - Include the beta header
advanced-tool-use-2025-11-20when these features are enabled
Use Case
Enables building production-grade agents that can:
- Work with hundreds or thousands of tools without context window overflow
- Process large datasets efficiently by keeping intermediate results out of context
- Achieve higher accuracy through concrete usage examples
- Reduce latency by orchestrating multiple tool calls in code rather than through individual API round-trips
Alternatives Solutions
No response
Additional Context
- Anthropic blog post: https://www.anthropic.com/engineering/advanced-tool-use
- API documentation: https://platform.claude.com/docs/en/agents-and-tools/tool-use/
- Released: November 24, 2025
- Beta feature requiring opt-in header
Tracking tool search in https://github.com/strands-agents/harness-sdk/issues/263
Porting programmatic tool calling tool from strands-tools to harness-sdk/vended-tools in https://github.com/chaynabors/harness-sdk/pull/57
Adding a use case for the tool search part of this issue.
We run an agent on Amazon Bedrock through BedrockModel with 65 to 80 tools across several domains. The tool definitions come to roughly 15k tokens and are re-read on every model call, and Anthropic documents that tool selection degrades past 30 to 50 tools. The tool search tool (tool_search_tool_regex_20251119 / tool_search_tool_bm25_20251119 plus defer_loading: true) addresses both, and it keeps the cached prefix intact because discovered definitions are added inline in the conversation.
What blocks it in the Python SDK today:
BedrockModelcalls the Converse API, and Bedrock does not offer tool search through Converse. It is only available through the Messages API endpoint and InvokeModel.AnthropicModelpasses server tools throughanthropic_tools, but it builds function tools fromToolSpecwith onlyname,descriptionandinput_schema, so there is no way to setdefer_loading. It also constructs only the first-party client, and it has no Bedrock Guardrails support.- The tool selection design (the
Hidestrategy) filters the tool list per invocation. On Converse every change to the tool list invalidates the prompt cache from the tools onward, and the cache-preserving provider-native mode the design leaves for later does not exist on Converse, so it is not a substitute for deferred loading.
What we need is a supported way to mark tools as deferred and include the tool search tool on a Bedrock path that also supports guardrails, for example the InvokeModel provider in #1217.