claude_thinking_tools_errorTier 1 · 70% confidence

ai-agents-claude-thinking-tool-using-claude-reasoning-models-e-g-claude-sonnet-3--0f76ccc4

agent: ai_agents

When does this happen?

IF Using Claude reasoning models (e.g., Claude Sonnet 3.7) with tools enabled via LiteLLM proxy results in a 400 error: 'Expected thinking or redacted_thinking, but found tool_use.'

How others solved it

THEN Disable thinking for Claude models when using native tool calling, or switch to default (non-native) tool calling. If thinking is required, ensure the conversation history includes a thinking block from the previous assistant turn before the tool_use block, per Anthropic's extended thinking requirements.

// LiteLLM config to disable thinking for Claude models when tools are used
model_list:
  - model_name: claude-sonnet-3.7
    litellm_params:
      model: bedrock/claude-3-7-sonnet-thinking
      disable_thinking: true  # or set thinking parameter to false in the request

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics