A multi-agent system has an orchestrator that must detect when all subagents in a parallel execution group have completed and consolidate their results. The orchestrator submits 5 parallel tool calls in one assistant turn. What is the correct API pattern for receiving and acknowledging all 5 tool results before proceeding?
Select an answer to reveal the explanation.
Short Explanation
Here's the deal — you need to collect all five tool outputs and send them back in one user message with five tool_result blocks, each tied to its tool_use_id. That lets the model see all results together and continue the same conversation thread.
Full Explanation
The correct pattern is to collect all five tool outputs, then submit a single request with a user message containing five tool_result content blocks, each referencing its corresponding tool_use_id from the prior assistant turn. The Anthropic API requires that all tool results for a set of parallel tool calls be returned in a single user message before the next assistant response is requested. The user message includes one tool_result content block per tool_use block from the prior assistant message, each matching by tool_use_id. The model then generates its next response with access to all five results simultaneously. The approach that submits five separate requests, one per tool result, building up the assistant message incrementally is wrong because it would create five separate conversation branches rather than resuming the single conversation thread; the multi-turn protocol requires all results in one user message. The approach that uses the Batch API to submit all five tool results simultaneously is wrong because the Batch API is for high-volume independent requests, not for managing tool result returns in a single agent conversation; it operates at a different level of abstraction. The approach that responds with the first available tool result and includes placeholder text for the remaining four results is wrong because the API does not support placeholder tool results or asynchronous partial result submission; all tool_use blocks from the prior assistant turn must be resolved in the next user message.