Agents & tools

Tool

Also called: function, function calling

A tool is a named action, with a typed input schema, that a model is allowed to call. Tools are how a model that can only produce text gets to actually do things: read a file, run a command, search the web.

James Phoenix
Understanding Data Updated July 2, 2026

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.

TypeScript
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.
Tip
More tools is not automatically better. Every tool definition sits in the context window and adds a choice the model has to reason about. A tight, well-described toolset beats a huge one.

Related terms

Building with AI agents?

This dictionary is part of how I think about agentic engineering. If you want the same thinking applied to your codebase, that is what I do.

See how I can help