MCP vs Function Calling vs Custom Tools: Choosing How Your Agent Reaches Data

Your agent needs data to do useful work. It has to read a calendar, query a database, or fetch a file before it can answer. The question is how you give it that access. MCP vs function calling vs custom tools is the choice every agent builder faces, and the wrong pick shows up fast as brittle code, slow setup, or a tool your model cannot use twice in a row.

All three approaches connect a model to outside systems. They differ in who defines the interface, who owns the plumbing, and how much work it takes to add the next tool.

MCP vs Function Calling: What Actually Differs

Function calling is a feature of the model provider. You describe a function in JSON schema, the model decides when to call it, and your code runs it. The model never touches your system directly. It only returns a structured request, and your application does the rest.

MCP, the Model Context Protocol, is an open standard for the same job. An MCP server exposes tools, resources, and prompts over a shared protocol, and any MCP-compatible client can use them. Instead of writing a new integration for every model provider, you write one server and any client that speaks MCP can connect to it. If you want the plain-English background first, our introduction to what MCP is and how it connects AI to your tools covers the protocol from the ground up.

Custom tools sit outside both. You build the interface yourself: a REST endpoint, a CLI wrapper, a Python function, or a small service the agent calls through code you control. Nothing is standardized and nothing is provided by the model vendor. That is the tradeoff. You get full control and you pay for it with maintenance.

How Function Calling Works

With function calling, you register tool definitions with the model on each request. Each definition has a name, a description, and a JSON schema for its arguments. The model reads the definitions, picks one when the conversation calls for it, and returns a function name plus arguments. Your code validates those arguments, runs the function, and sends the result back so the model can continue.

The plumbing is small and most major providers support it, so debugging is straightforward: you can log every call and every argument. The catch is that the definitions are tied to the provider’s format, so moving to a different model may mean rewriting the schemas. You also own retries, timeouts, and error handling. Our guide to structured output with JSON schema, function calling, and validation errors shows how argument validation fails in practice and how to handle it.

Function calling fits best when your agent runs on one provider, your toolset is small, and your tools are simple operations like “look up order status” or “create a ticket.” It starts to strain when you have dozens of tools, because every definition eats context on every request.

How MCP Works

An MCP server is a small program that exposes tools over a standard protocol. The client, which might be a coding assistant, a desktop app, or your own agent, discovers the tools the server offers and passes them to the model. The model picks a tool, the client routes the call to the server, and the result flows back.

The main win is reuse. One MCP server works with every client that supports the protocol, so you stop writing the same integration for each new model or app. Our walkthrough on how to build an MCP server from scratch takes you from an empty project to a working one.

The cost is a new moving part. You run a server process, you manage its lifecycle, and you debug protocol issues on top of your own code. MCP servers also vary in quality. Some expose clean, narrow tools with clear descriptions. Others expose broad tools with vague names, and the model will guess wrong about what they do.

How Custom Tools Work

Custom tools are whatever you build yourself. A typical pattern is a set of Python functions the agent calls directly, or HTTP endpoints your agent code invokes after the model asks for them in plain text. There is no standard schema, no discovery step, and no client-server split unless you add one.

This is the right choice when the work is unusual. Maybe your tool needs to run inside a specific network, talk to a legacy system with odd authentication, or enforce business rules that no standard covers. Custom code handles all of that because you write every line of it.

The downside is the obvious one: you maintain it. Every new model, every new client, and every schema change means more of your code to update. Custom tools also tend to grow quietly. A three-function helper becomes a twenty-function module with shared state and undocumented behavior, and the agent starts calling the wrong function because the descriptions blurred together. For background on the protocol side of this choice, our plain-English explainer on what the Model Context Protocol is helps to separate what MCP standardizes from what stays custom.

MCP vs Function Calling vs Custom Tools Compared

The table below puts the three side by side on the points that matter most when you are choosing.

Factor Function Calling MCP Custom Tools
Who defines the interface Model provider Open protocol standard You
Works across providers Needs rework per provider Yes, any MCP client Yes, if you build it that way
Setup effort Low Medium, server to run Medium to high
Control over execution Full, in your code Shared with the server Full, in your code
Tool discovery Manual, per request Built in, server lists tools Manual, you wire it up
Best for Small toolsets, one provider Shared tools, many clients Unusual systems, strict rules
Main risk Provider lock-in, context bloat Server upkeep, uneven tool quality Maintenance debt, scope creep

When to Pick Each One

Pick function calling when you are building a single agent on one provider and your tools number in the single digits. A support bot that checks order status, looks up a knowledge base, and files a ticket is a textbook case. You get running in an afternoon and the failure modes are easy to see in logs.

Pick MCP when the same tools need to serve more than one agent or more than one app. If your team wants the database, the ticketing system, and the file store available in a coding assistant, a chat agent, and an internal dashboard, one MCP server beats three separate integrations.

Pick custom tools when the integration is genuinely specific: a legacy system, a workflow with approval steps that cannot be expressed as a simple function call, or a system where the model must never see raw data and your code has to filter results first.

Mixing the Three in One Agent

Most real agents do not pick one approach and stop. A common shape is function calling for the two or three tools the agent uses every turn, MCP for shared company tools that several agents need, and a custom tool for the one weird system nobody else touches.

Watch the total tool count either way. An agent with forty tools makes worse choices than an agent with eight, no matter which mechanism delivers them. Group related operations into one tool with clear parameters instead of exposing a separate tool for every small variation. And put limits in place early: step limits, timeouts, and a rule that stops the agent from calling the same failing tool twice. Our guide on how to stop an AI agent from looping covers timeouts, step limits, and guardrails that keep a tool-calling agent from burning through your budget on a loop.

Mistakes to Avoid

The most common mistake is exposing too much. A tool called “run_query” with no limits invites the model to pull an entire table. Give tools narrow jobs, clear names, and descriptions that say what the tool does and what it will not do.

The second mistake is trusting tool output without checking it. Tool results can contain text from untrusted sources, and a model that treats tool output as instructions can be steered into actions you did not want. Validate results in your code before acting on them, especially when a tool touches money, deletes data, or sends messages.

The third mistake is skipping the boring work: logging every call and reviewing the failures weekly. Tool usage data tells you which descriptions confuse the model and which tools never get called at all. That feedback loop is what turns a demo agent into one you can run in production.

Start with the simplest option that covers your case. Add MCP when sharing becomes the bottleneck, and build custom tools only for the systems that truly need them.

Ditulis oleh

Firdaus Safari Putra

Founder, PT FirKaizen Digital Solutions

Firdaus Safari Putra adalah founder PT FirKaizen Digital Solutions. Ia membangun dan mengoperasikan infrastruktur server di balik panduan ini, dan menulis berdasarkan apa yang benar-benar ia jalankan, uji, dan ukur — bukan teori.