# Parallel tool calls

The model can request several tool calls in one reply. Run them all, then send back one tool message per call.

AI developers · Part 03: Tool calling · Card 9 of 10 · Last updated 2026-10-13

## Analogy

Promise.all for the model. Why fetch three orders one by one when you can ask for all three at once?

## Code example

`parallel.ts`

```typescript
const results = await Promise.all(
  message.tool_calls.map(async (call) => ({
    role: "tool" as const,
    tool_call_id: call.id,
    content: JSON.stringify(await runTool(call)),
  })),
);
messages.push(message, ...results);
```

## In an agent

Parallel calls cut the number of loop rounds, which saves both time and tokens.

## Questions people ask

### Can the model call several tools at once?

Yes. One reply can contain several entries in tool_calls, for example fetching three orders. Run them together with Promise.all, then append one tool message per call, each with its own tool_call_id, before calling the model again. This saves loop rounds, which saves time and tokens.

### What happens if I skip one of the parallel tool results?

The API expects a tool message for every tool call id in the assistant's message. If one is missing, the next request is usually rejected as invalid. If a tool fails, still send a tool message for it, containing a short error, so the model knows what happened and can decide what to do.

## Related concepts

- [What a tool is](https://studyvisually.com/learn/tech/ai-developers/tool-calling/what-a-tool-is)
- [Function schema](https://studyvisually.com/learn/tech/ai-developers/tool-calling/function-schema)
- [Tool description](https://studyvisually.com/learn/tech/ai-developers/tool-calling/tool-description)
- [The tool_calls reply](https://studyvisually.com/learn/tech/ai-developers/tool-calling/tool-calls-response)

Web page: https://studyvisually.com/learn/tech/ai-developers/tool-calling/parallel-tool-calls
Study this card in the app: https://studyvisually.com/app/learn?category=ai-developers&card=parallel-tool-calls
