Back to library
AI
news

Scale Agent Capabilities Dynamically with Mid-Conversation Tool Swapping

Dynamically swap AI tools without losing your current progress or speed.

Use the 'mid-conversation-tool-changes' beta header to modify available AI tools turn-by-turn without losing the speed benefits of prompt caching.

Claude

The Scenario

You are building an AI agent that initially only needed to read files, but now needs to execute code or fetch live data based on the user's latest request.

Before & after

The old way

You had to declare all potential tools (calculators, search, database access) at the very start. If you forgot one, you'd spend 5–10 minutes restarting the session and copying your progress.

With AI

Enable 'mid-conversation-tool-changes-2026-07-01' to add/remove tools dynamically. The AI gains new capabilities in seconds without you needing to restart the session or wait for re-caching.

The Prompt

// When sending your next API request to Claude Opus 5, add this to the headers:
// "anthropic-beta": "mid-conversation-tool-changes-2026-07-01"
// Then, update your 'tools' array in the message body to include new functions like [NEW_TOOL_NAME].

New beta support allows adding or removing tools between conversation turns on models like Opus 5 and Opus 4.8 while keeping prompt caching intact.

Source

Claude Platform release notes - Claude Platform Docs
"add or remove tools between turns of a conversation while preserving the prompt cache."