On its own a model just writes text. A tool is what gives it reach. You define a tool by giving it a name, a description, and a schema for its inputs, then hand that definition to the model. The model can now choose to call the tool, and your code runs the real action behind it.
A tool definition
Here is a minimal tool an agent might expose. Note that the definition is just a description and an input schema. It contains no logic; the actual work lives in your code.
const readFileTool = {
name: 'read_file',
description: 'Read a UTF-8 text file from the working directory',
input_schema: {
type: 'object',
properties: {
path: { type: 'string', description: 'Path relative to the repo root' },
},
required: ['path'],
},
}The description matters more than it looks. The model decides *whether* and *how* to use a tool based on that text, so a vague description leads to misuse and a sharp one leads to the tool being called at the right moments.
Two ways tools get added
- Built in. The agent ships with a core set: read, write, run a command, search.
- Via [MCP](/ai-coding-dictionary/mcp). The Model Context Protocol lets you plug in external tools without modifying the agent, so a database or ticketing system becomes callable the same way a built-in tool is.
Related terms
Tool call
A tool call is the model’s request to use a tool: it names the tool and supplies the arguments, then pauses. It has not run anything. Your harness is what actually executes the action.
Read definition →Tool result
A tool result is the output of running a tool, fed back into the conversation so the model can use it. It is tied to the tool call that requested it, and it is how the model sees the consequences of its own actions.
Read definition →MCP (Model Context Protocol)
MCP is an open standard for connecting agents to tools and data. Instead of hard-coding an integration into every agent, you run an MCP server once and any MCP-aware agent can use it.
Read definition →