promptdojo_

Multi-step tools — when one tool isn't enough — step 7 of 9

The model returned two tool_use blocks in one assistant turn — classic parallel tool calls. The reply builder runs both tools but hardcodes both tool_use_id values to "t1". The next API call will 400 because tool ids must match the originals (t1 and t2).

Fix the loop so each tool result carries its own original id.

Expected output:

['t1', 't2']
The break is on line 14 — but read the whole snippet first.

full-screen editor opens — close anytime to keep reading.