# Streaming tool_use input accumulation
1. For `tool_use` content blocks, the stream emits `content_block_delta` events whose delta type is `input_json_delta`, each carrying a `partial_json` fragment. These deltas update the `input` field of the block.
2. Accumulate the fragments per content-block index into a string buffer. Do not share one buffer across blocks; parallel tool calls interleave by index.
3. Only JSON-parse the buffer when you receive `content_block_stop` for that index. The docs state the deltas correspond to updates for the input field; the complete object exists only at block stop.
4. Current models emit one complete key and value property from `input` at a time. Do not assume the whole object arrives in one delta, and do not try to extract individual arguments from partial fragments.
5. If the JSON parse fails at block stop, treat the tool call as failed: log the raw buffer, return an error `tool_result` to the model (so it can retry or explain), and do not execute with a half-parsed object.
6. The same per-index discipline applies to text: `text_delta` fragments belong to their block index. Mixing indices garbles both text and tool arguments.
Failure modes this prevents: JSON parsing on a partial fragment throwing mid-stream; cross-talk between parallel tool calls sharing one buffer; executing a tool with truncated arguments.