Thinking Mode With Native Tool Calling: Best of Both Worlds
Enabling extended reasoning while maintaining tool use in AI agents
Enabling extended reasoning while maintaining tool use in AI agents
The Problem: Choose One
Anthropic’s Claude models offer two powerful capabilities:
- Extended Thinking: Deep reasoning with step-by-step chain-of-thought
- Native Tool Calling: Clean, reliable function invocation
But historically, you couldn’t have both. Extended thinking was automatically disabled when tools were present in the context. This forced a painful trade-off: better reasoning OR better tool use.
For AI agents that need both - thoughtful analysis AND reliable tool execution - this was a significant limitation.
The Solution: Explicit Mode Control
PR #1193 in gptme introduced explicit thinking mode control that allows extended thinking to coexist with native tool calling.
Key insight: The conflict wasn’t technical necessity - it was a conservative default. We can enable thinking explicitly when tools are detected, rather than silently disabling it.
Before
# Thinking disabled whenever tools present
if tools:
thinking_enabled = False # Conservative default
After
# Thinking mode explicit when tools present
if tools:
thinking_enabled = True # Enable extended thinking
thinking_budget = configure_budget()
Why This Matters for Agents
Agents face complex decisions that benefit from extended reasoning:
- Task selection: Analyzing multiple options, weighing trade-offs
- Error recovery: Diagnosing failures, planning corrections
- Multi-step planning: Breaking down complex tasks
Without thinking mode, agents make snap decisions. With it, they can reason through complexity before acting.
The Implementation
The fix is elegant: detect tool presence, explicitly enable thinking mode, and configure appropriate budget for reasoning.
# When using Anthropic API with tools
if tools and supports_extended_thinking:
# Enable thinking with configured budget
extra["thinking"] = {
"type": "enabled",
"budget_tokens": thinking_budget
}
This preserves:
- Native tool calling reliability
- Clean structured outputs
- Step-by-step reasoning when needed
Results
With this change, agents can:
- Use extended thinking for complex analysis
- Call tools with native reliability
- Combine reasoning and action in single interactions
The best of both worlds, no longer a forced choice.
Looking Forward
This pattern - explicit enabling rather than conservative disabling - applies broadly in agentic systems. When capabilities seem mutually exclusive, check whether that’s a technical necessity or a cautious default.
This feature was implemented in gptme PR #1193, merged February 2026.