# Tool

> A function the harness exposes for the agent to call — Read, Write, Bash, Search. How an agent perceives and acts on the environment.

A function the [harness](https://ai9k.vercel.app/en/harness) exposes for the [agent](https://ai9k.vercel.app/en/agent) to call — Read, Write, Bash, Search. Tools are how an agent perceives and acts on the [environment](https://ai9k.vercel.app/en/environment): it can't see the environment except through [tool results](https://ai9k.vercel.app/en/tool-result), and can't change it except through [tool calls](https://ai9k.vercel.app/en/tool-call). Each tool call costs an extra [model provider request](https://ai9k.vercel.app/en/model-provider-request), since the result has to go back to the model before it can decide what to do next.

Tools most coding agents ship with:

| Tool   | What it does                                                 |
| ------ | ------------------------------------------------------------ |
| Read   | Returns a file's contents as a tool result                   |
| Write  | Creates or edits a file in the [filesystem](https://ai9k.vercel.app/en/filesystem) |
| Bash   | Runs a shell command and returns its output                  |
| Search | Finds files or text matching a pattern across the codebase   |

A tool is defined by three things: a name, a description of what it does, and a schema for its parameters. The harness sends these definitions to the [model](https://ai9k.vercel.app/en/model) with every request, and the model chooses a tool the same way it produces everything else — by writing [tokens](https://ai9k.vercel.app/en/token), in this case a structured call with arguments. The model never executes anything itself; the harness reads the call, runs the function, and sends back the result.

The tool list sets what the agent can do. A capable model with a narrow tool set is a narrow agent: it will route everything through whatever it has, which is why agents lean so heavily on Bash — a shell is one tool that reaches most of the system. To give an agent a capability cleanly, add a tool for it; [MCP](https://ai9k.vercel.app/en/mcp) is the standard for plugging in tools from outside the harness.

Tool definitions occupy [context](https://ai9k.vercel.app/en/context) on every request, so a large tool set has a standing cost before any tool is called — and many similarly-described tools make the model worse at picking the right one.

**Usage**

"Can the agent query staging directly?"

"Add a `psql` tool to the harness, scoped read-only on staging. Without a tool for it, the agent's blind to anything outside the filesystem."

---

- Section 3 — Tools & Environment · Term 27 of 72
- Page: https://ai9k.vercel.app/en/tool
- Learn step by step: https://ai9k.vercel.app/en/learn#/tool
- On the map: https://ai9k.vercel.app/en?term=tool
- JSON: https://ai9k.vercel.app/data/terms/tool.json
- Mentioned in: [Model](https://ai9k.vercel.app/en/model.md), [Inference](https://ai9k.vercel.app/en/inference.md), [Harness](https://ai9k.vercel.app/en/harness.md), [Model provider request](https://ai9k.vercel.app/en/model-provider-request.md), [Agent](https://ai9k.vercel.app/en/agent.md), [System prompt](https://ai9k.vercel.app/en/system-prompt.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 call](https://ai9k.vercel.app/en/tool-call.md), [MCP](https://ai9k.vercel.app/en/mcp.md), [Permission request](https://ai9k.vercel.app/en/permission-request.md), [Permission mode](https://ai9k.vercel.app/en/permission-mode.md), [Skill](https://ai9k.vercel.app/en/skill.md), [AX](https://ai9k.vercel.app/en/ax.md)
- Previous: [Filesystem](https://ai9k.vercel.app/en/filesystem.md)
- Next: [Tool call](https://ai9k.vercel.app/en/tool-call.md)

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