Parallel tool calling
message in flightlatency
- The model emits a structured tool_use block with an ID.
- The host validates and dispatches the call.
- tool_result returns, matched by tool_use_id.
- Independent calls fan out in one turn, saving a round-trip.
Notes & references
Use when
Independent, read-only lookups.
Avoid
Concurrent calls with data dependencies or side effects.
# one model turn, two independent requests
reply.tool_calls = [
{ id: "1", name: "weather", input: { city: "Paris" } },
{ id: "2", name: "fx_rate", input: { pair: "EUR/USD" } },
]
# your code runs both at once
results = await gather(*[run(c) for c in reply.tool_calls])
# each result carries its matching id
messages.append([{ id: c.id, content: r } for c, r in ...])
- Tool use with ClaudeAnthropic
- Writing effective tools for AI agentsAnthropic
- Parallel tool useAnthropic
- Function callingOpenAI