Claude Certified Architect – Foundations Practice Question 19: Parallel Tool Results
Claude Certified Architect, Foundations · Test 2 · question 9 of 10
A developer's agent loop works when Claude requests one tool at a time. When Claude returns an assistant message with three tool_use blocks (weather for three cities), the loop executes each tool and appends a separate user message containing one tool_result block per call. After that, Claude stops calling tools in parallel and sometimes gives wrong answers, or the API rejects the request. What change fixes the loop?
Show answer and explanation
Answer:
A is correct. When Claude makes parallel tool calls, all tool_result blocks must be returned in a single user message, each matched to its call by tool_use_id, and every tool_result must come before any text content in that message. Sending results in separate user messages teaches the model that parallel calls are not expected, which reduces future parallel use and can cause errors.
B is wrong because tool results are always sent in the user role; assistant messages are Claude's turns. C is wrong because it only hides the symptom by giving up parallelism while leaving the malformed layout in place. D is wrong because each tool_use block needs its own tool_result with the matching ID; merging them leaves two calls unanswered and the request is invalid.
Reference: Parallel tool use