# Tool call

> The model's output naming a tool and its arguments — just structured text. The harness has to read it and execute.

The [model](https://ai9k.vercel.app/en/model)'s output naming a [tool](https://ai9k.vercel.app/en/tool) and its arguments — just structured text. It doesn't do anything on its own; the [harness](https://ai9k.vercel.app/en/harness) has to read it and execute. Produced by the model in one [model provider request](https://ai9k.vercel.app/en/model-provider-request).

The lifecycle of a tool call:

| Step | Who     | What happens                                                                            |
| ---- | ------- | --------------------------------------------------------------------------------------- |
| 1    | Model   | Learns which tools exist from descriptions in the [system prompt](https://ai9k.vercel.app/en/system-prompt) |
| 2    | Model   | Emits a call — tool name plus arguments, usually JSON — and stops                       |
| 3    | Harness | Parses the call and checks it against the [permission mode](https://ai9k.vercel.app/en/permission-mode)     |
| 4    | Harness | Executes it if allowed                                                                  |
| 5    | Harness | Sends the outcome back as a [tool result](https://ai9k.vercel.app/en/tool-result) in the next request       |

One [turn](https://ai9k.vercel.app/en/turn) of [agent](https://ai9k.vercel.app/en/agent) work is usually many of these round trips chained together.

Because the call is generated by [next-token prediction](https://ai9k.vercel.app/en/next-token-prediction) like everything else, it can be wrong the way any model output can be wrong: a path that doesn't exist, a flag the command doesn't have, arguments that are plausible rather than correct. The harness executes what was written, not what was meant — a mistyped path doesn't error gracefully, it edits the wrong file.

**Usage**

"It said it ran the tests but the file timestamps haven't changed."

"Look at the transcript — did it actually emit a tool call, or just describe running them? The model produces the call, but if the harness didn't execute it, nothing happened."

---

- Section 3 — Tools & Environment · Term 28 of 72
- Page: https://ai9k.vercel.app/en/tool-call
- Learn step by step: https://ai9k.vercel.app/en/learn#/tool-call
- On the map: https://ai9k.vercel.app/en?term=tool-call
- JSON: https://ai9k.vercel.app/data/terms/tool-call.json
- Mentioned in: [Next-token prediction](https://ai9k.vercel.app/en/next-token-prediction.md), [Harness](https://ai9k.vercel.app/en/harness.md), [Model provider request](https://ai9k.vercel.app/en/model-provider-request.md), [Output tokens](https://ai9k.vercel.app/en/output-tokens.md), [Context window](https://ai9k.vercel.app/en/context-window.md), [Turn](https://ai9k.vercel.app/en/turn.md), [Environment](https://ai9k.vercel.app/en/environment.md), [Filesystem](https://ai9k.vercel.app/en/filesystem.md), [Tool](https://ai9k.vercel.app/en/tool.md), [Tool result](https://ai9k.vercel.app/en/tool-result.md), [Permission request](https://ai9k.vercel.app/en/permission-request.md), [Permission mode](https://ai9k.vercel.app/en/permission-mode.md), [Agent mode](https://ai9k.vercel.app/en/agent-mode.md), [Context pointer](https://ai9k.vercel.app/en/context-pointer.md), [Subagent](https://ai9k.vercel.app/en/subagent.md), [Automated check](https://ai9k.vercel.app/en/automated-check.md)
- Previous: [Tool](https://ai9k.vercel.app/en/tool.md)
- Next: [Tool result](https://ai9k.vercel.app/en/tool-result.md)

Every term page has a markdown copy: add .md to its address.
