Anthropic Divergence: Tool-Use Content Blocks
Explore how to manage tool-call streams from different AI providers by building adapters that normalize input and events. Understand how to accumulate and parse tool arguments incrementally or upon completion within a consistent reducer state machine. This lesson helps you maintain multi-turn state and ensure reliable tool use without re-executing actions.
A common portability constraint is keeping one internal reducer and one persisted tool-call record format, even when tool-call streams come from different providers. The practical move is to swap only an adapter that turns provider stream frames into your internal events.
Two surfaces force most parsing changes. The first is how the stream announces tool intent, meaning when the reducer should create a new in-flight tool call. The second is how arguments arrive over time, meaning what you accumulate and when you treat it as parseable.
Where tool calls start and how args stream
With your state machine held constant, the adapter must branch on the provider framing. One stream might explicitly start a ...