Skip to content

AI Agents

Tool Calling and MCP: How AI Agents Take Real Actions

By Niall · 7 min read

Tool calling and MCP are what turn a model that talks into an agent that does, and they are where the risk lives.

Share

A language model on its own can only produce text. It cannot check your inventory, send an email, or update a record. The moment you want an AI to do something rather than just describe it, you need a bridge between the model and your real systems. That bridge is tool calling, and the emerging standard for doing it safely is the Model Context Protocol.

Both ideas sound technical, and the implementations can be, but the concepts are simple and worth understanding before you commission any agent. They decide what your AI can touch, how reliably it behaves, and how much of your business you are exposing. Here is how they work and where the sharp edges are.

What tool calling actually is

Tool calling, sometimes called function calling, lets a model invoke a typed function you define instead of answering in prose. You describe each tool with a name, a description, and a schema for its inputs. The model reads the user's request, decides which tool fits, and returns a structured call with arguments that match your schema. Your code runs the function and hands the result back.

The important word is typed. The model is not running your code directly, and it is not guessing at free-form text. It is filling in a contract you defined, which your application validates before anything happens. A tool might query a database, hit an API, file a ticket, or run a calculation. The model chooses; your code controls.

A quick example

  • A user asks an agent: 'How many units of the blue jacket are left in the Charleston store?'
  • The model picks your check_inventory tool and returns a call with the product and location filled in.
  • Your code runs the query, gets the number, and returns it to the model.
  • The model turns that result into a clear sentence for the user.

Nothing magical happened. The model did the reasoning about intent; your system did the actual work and stayed in charge of the data. That division of labour is the whole point, and it is what makes tool calling safe enough to use in production.

Where MCP comes in

Tool calling works, but every team was wiring it up differently, with bespoke glue between each model and each system. The Model Context Protocol, MCP, is an open standard that tidies this up. It defines a common way for AI applications to discover and call tools, read data, and use prompts, through a client and server model.

In practice, you run an MCP server in front of a system, your database, your ticketing tool, your internal API, and it exposes a set of typed tools. Any MCP-aware client, including many AI assistants and agents, can connect, list what is available, and call those tools through the same protocol. Build the server once and many clients can use it, rather than rebuilding the integration for each one.

It helps to think of MCP as doing for AI tool access what a common port did for hardware: a single, predictable way to plug things together. The model does not need to know how your database works, only that a typed tool exists, what it expects, and what it returns.

Why a standard matters

  • Reuse: one MCP server for your CRM can serve every agent and assistant you build.
  • Interoperability: tools are described in a consistent, typed way, so clients know exactly how to call them.
  • Separation: the team that owns a system owns its server and its rules, not whoever happens to be building an agent.
  • Portability: swap the model or the client without rewriting every integration underneath.

If you have ever maintained a dozen one-off integrations that all broke when an API changed, the appeal is obvious. A shared protocol turns a sprawl of bespoke connectors into a small number of well-defined servers you can secure, version and reason about.

The security notes that matter most

Giving an AI access to your tools and data is exactly as serious as it sounds. A tool that can read records can leak them; a tool that can write or delete can do real damage if it is called with the wrong arguments. Treat every tool you expose as a permission you are granting, and grant the narrowest one that does the job.

Every tool you expose to a model is a door into your systems. Scope each one to the least access it needs, log every call, and require human approval before anything destructive or irreversible runs.

Scoping and review in practice

  • Scope tightly: read-only where possible, and limit which records or actions a tool can touch.
  • Validate inputs: never trust the arguments a model produces; check them as you would any external input.
  • Require approval: put a human in front of high-stakes actions like payments, deletions or external messages.
  • Log everything: record each tool call and its result so you can audit what the AI actually did.
  • Review the surface: revisit which tools are exposed as your agent grows, and remove what is not used.

None of this is exotic security work. It is the same discipline you would apply to any system that can touch production data, applied to a new kind of caller that happens to be a model. The teams that get burned are the ones who treat an AI's access as somehow less real than a person's.

Tool calling and MCP are what turn a clever chat interface into an agent that does useful work inside your business. They also concentrate risk in a small, reviewable place, which is good news if you design them deliberately. When we build AI agents, getting this layer right, typed tools, tight scopes, clear logging and human review where it counts, is most of the job.

Charleston waterway at sunset with palmetto silhouettes

Get in touch

Have a project in mind? Let's talk.

If this is relevant to what you're building, a short email is the fastest way to get practical help.