Swap tools mid-conversation without nuking your prompt cache: `defer_loading` plus `tool_addition`/`tool_removal` blocks
A beta shipped with Opus 5 (`mid-conversation-tool-changes-2026-07-01` header) fixes the worst cache-invalidation footgun in agent design: the `tools` array "sits even earlier in the hashed request prefix than the top-level `system` field, so editing it invalidates the prompt cache for the entire conversation." You now declare the full tool set up front — marking tools `defer_loading: true` to keep them withheld — then surface or withdraw them with `tool_addition`/`tool_removal` content blocks inside a `role: "system"` message, referencing tools by name via `{"type": "tool_reference", "name": "..."}`. MCP tools can be swapped individually (`mcp_tool_reference`) or as a whole server (`mcp_toolset_reference`), which is the practical answer to MCP tool-list bloat without paying a full cache rebuild per phase.
↳ Follow the thread