Skip to main content

model_supports_tool_search

Function model_supports_tool_search 

Source
pub fn model_supports_tool_search(model: &str) -> bool
Expand description

Returns true for models that support (and require) adaptive thinking: thinking: {type: "adaptive"} with NO budget_tokens field.

Per Anthropic’s docs as of 2026-04: Opus 4.6+/Sonnet 4.6+ deprecated the fixed-budget {type: "enabled", budget_tokens: N} shape. On those models the deprecated shape is silently accepted but returns no thinking content (observed S172 on Opus 4.7). Older models (Opus 4.5, Sonnet 4.5, Haiku, Opus 3.x) still use the enabled+budget shape.

Adaptive thinking also auto-enables interleaved thinking — no beta header required. Whether an Anthropic model supports tool search, i.e. defer_loading tool definitions expanded by tool_reference blocks. Anthropic’s compatibility table lists Haiku 4.5, Sonnet 4.5+, Opus 4.5+ and every 5.x family; Opus 4.1 and earlier (and Sonnet 4 / the 3.x line) do not support it. Unknown future claude-* ids are assumed to support it.