Function calling governs LLM to host communication; MCP governs host to tool communication. They are complementary layers, not alternatives.
Imagine ordering food at a restaurant. You tell the waiter what you want by filling out a slip with the dish name and how you want it cooked. That slip is function calling: a standard way for the customer (the model) to communicate an order to the waiter (the host). Now the waiter walks to the kitchen. The kitchen might be in house or it might be an outside caterer. MCP is the standard form the waiter uses to talk to any kitchen, whether it is next door or across town. The waiter still needs the customer's slip to know what to order, and the waiter still needs the kitchen form to actually get food made. Neither replaces the other. They sit on different sides of the waiter, solving different problems. In the AI world, the model fills out the slip (function calling), the host carries it, and the host hands it to the right MCP server (kitchen) to get the actual work done.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Function calling and MCP are the two concepts most often muddled in agent architecture interviews. People treat them as alternatives or assume MCP makes function calling obsolete. Neither is true. They live on opposite sides of the agent host and solve different problems at different layers.
This deep dive pins down each protocol's job, walks one turn of a real agent to show the handoff between them, and closes with the portability payoff and the failure mode contrast that proves they are genuinely distinct layers.
The two boundaries in an agent host
Every tool using agent has a host process sitting in the middle. On one side sits the LLM. On the other side sits the tool implementation. Each side needs a wire format.
The LLM to host boundary is owned by function calling. The model emits a structured tool call object through its provider's API: OpenAI tools, Anthropic tool_use blocks, Gemini function_declarations, and equivalent surfaces on open weight models like Llama, Qwen, and DeepSeek. The structure is guaranteed at the sampling layer (constrained decoding or grammar aware sampling) so the host receives a deterministic JSON object rather than having to regex parse free text.
The host to tool boundary is owned by MCP. The host speaks JSON-RPC 2.0 to an MCP server. Tools live in that server, not in the host. The server might run as a local subprocess on stdio or as a remote service on streamable HTTP. The host discovers tools via tools/list, invokes them via tools/call, and reads results as structured content arrays.
The one line summary: function calling is how the model emits the call; MCP is how the host fulfills it. Both happen on every tool using turn of a modern agent.
Situations where this technique stops working.
2–4 min · Everything important, quickly.
Real products, models, and research that use this idea.
- Claude Desktop uses Anthropic tool_use (function calling) on the model side and MCP on the tool side. Adding a new MCP server to the config gives the model access to new tools without any prompt changes.
- Cursor advertises MCP servers as tools to whichever LLM the user selects (Claude, GPT, Gemini, or a local open weight model). Each model uses its own function calling API while the integration layer stays MCP.
What an interviewer would ask next. Try answering before peeking at the approach.
QTrace one turn of a 2026 agent end to end. Where does function calling stop and MCP begin?
Model emits a tool_use block via Anthropic's tools API (function calling boundary). Host parses it, looks up the tool in its MCP registry, sends a tools/call JSON-RPC request to the right server (MCP boundary). Server executes and returns a content array. Host wraps the result as a tool_result message and feeds it back into the next model call (function calling boundary again).
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Treating MCP as a replacement for function calling. They solve different problems on opposite sides of the host process and a modern agent depends on both simultaneously.
60 second bullets to scan on the way to the call.
Name the two boundaries: LLM to host (function calling) and host to tool (MCP)
State what function calling guarantees: structured output at the sampling layer
Primary sources. Browse if you want the original framing.
Same topic, related formats. Practice these next.