Kavvo Agents

How to Give an Agent Tools

November 29, 2026 · 4 min read · By the Kavvo Agents team

What a tool is

A tool is something an agent can use to do work outside its own text. A tool can be a function that calculates, a search that finds information, an API call that looks up an order, or a database query that returns a record. Without tools, a model can only answer from what it already knows. With tools, it can read live data and take actions.

LangChain’s docs put it simply: tools give agents the ability to take actions, and an agent goes beyond a model-only reply by using tools in a loop to achieve a goal. The model decides which tool to call, the framework runs it, and the result goes back to the model for the next decision. That loop is what turns a chatbot into an agent.

The three ways to give an agent a tool

There are three common ways, and most agents use a mix of them.

First, a function tool. You write a function in code — in Python, a function decorated with @tool in LangChain or Pydantic AI — and give it to the agent. The function has a name, a description, and typed arguments. The model reads the description to decide when to use it. This is the most flexible way, and it is how developers add custom logic, such as looking up a record in their own database.

Second, an API tool. The agent calls an API over HTTP, such as a weather API, a CRM, or your own service. In no-code tools such as n8n, Zapier Agents, and Make, an API action is added as a tool from a library of apps. In code frameworks, you wrap the API call in a function and give that function to the agent. The agent does not need to know how the API works — it only needs the tool’s name, description, and arguments.

Third, MCP, the Model Context Protocol. MCP is an open standard from Anthropic for connecting AI applications to external systems. Its docs define it as an open-source standard for connecting AI applications to external systems, and compare it to a USB-C port for AI applications: one standard connection, many tools. An MCP server exposes tools, resources, and prompts, and an MCP client — such as Claude Code, Claude Desktop, or an agent framework — connects to it. Instead of writing a custom integration for each data source, you connect to an MCP server once, and the agent can use the tools it exposes. MCP uses a client-server design, with hosts, clients, and servers, and messages use JSON-RPC 2.0 over stdio or Streamable HTTP, according to the official specification.

What an agent can touch

An agent can touch anything you give it a tool for: web search, email, calendars, documents, databases, CRMs, spreadsheets, and your own APIs. It can also use tools that are themselves agents, such as a sub-agent that does research, or a workflow that runs a multi-step process.

How to connect a tool safely

Follow these rules, in order:

  1. Start read-only. Give the agent tools that only read data — search, lookup, and list — before you give it tools that write, send, or delete. Test the agent with read-only tools until it calls the right tool for the right reason.
  2. Give it only what the job needs. If the job is to look up orders, give it the order lookup tool, not your whole CRM. If the job needs one spreadsheet, give it that spreadsheet, not your whole drive.
  3. Write clear tool descriptions. The model picks tools by name and description, so a vague description leads to wrong choices. Say what the tool does, what it needs, and when to use it. Keep it short.
  4. Use separate credentials with limits. Give the agent its own API key, with only the permissions the job needs, and set a spending or rate limit where the provider allows it. Never give an agent your main admin key.
  5. Add approval for irreversible actions. Use human-in-the-loop, guardrails, or an approval step before the agent sends a message, changes data, or spends money. In n8n, that can be a manual approval step in the workflow. In code frameworks, it can be a guardrail or a middleware hook that pauses the run.
  6. Check MCP servers before you connect them. The MCP docs warn that community servers are untested and should be used at your own risk. Use official or well-maintained servers, read what tools they expose, and do not connect a server you have not checked. A malicious or buggy server can expose data or take actions you did not intend.
  7. Log everything. Record which tools the agent called, with what arguments, and what they returned. Read the logs for the first week, and keep a list of failures so you can fix the tool or the instructions that caused them.

A safe first setup

Sources