Back to library
AI
framework

Dynamically Update Agent Tools Mid-Conversation Using Beta Headers

Swap AI tools mid-chat without losing your conversation history or cache.

Use the mid-conversation tool change beta to dynamically update your AI's capabilities during a session while maintaining prompt cache efficiency.

Claude

The Scenario

You are building an AI agent that first needs to search the web, then subsequently needs to write to a database without losing the chat history.

Before & after

The old way

Developers had to restart entire conversation sessions to change the available toolset, losing progress and spending 10–15 minutes re-establishing context.

With AI

Use the 'mid-conversation-tool-changes-2026-07-01' beta header to swap or add tools in seconds while keeping your cached prompt active.

The Prompt

// In your API request header, include:
"anthropic-beta": "mid-conversation-tool-changes-2026-07-01"

// Between turns, update your 'tools' array:
{"tools": [new_tool_definition_here]}

The new beta feature allows you to add or remove tools between turns of a conversation. This is highly efficient for agentic workflows where different stages of a task require different specialized tools.

Source

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