
TL;DR
Function Calling, MCP, A2A, and RAG solve different layers of the same agent stack and combine cleanly in production.
Function Calling is a model-level feature where the LLM emits a structured call your app executes (OpenAI, 2023).
MCP is a protocol that standardizes how any AI client connects to any external tool, prompt, or resource (Anthropic, 2024).
A2A is a protocol for one agent to delegate work to another specialist agent (Google, 2025).
RAG is a retrieval pattern that grounds LLM outputs in indexed documents; it sits orthogonal to all three protocols.
Production pattern: Function calling inside MCP clients, A2A across agents, RAG as a resource any layer can serve.
What is MCP, RAG, A2A, and Function Calling? Quick definitions
MCP, RAG, A2A, and Function Calling are four named technologies that are reshaping how AI agents reach data, take actions, and collaborate. They sound similar because the industry positions them against each other, but each solves a different layer. Understanding the layer each one occupies is the fastest way to know which to use, when to combine them, and where they overlap.
Function Calling
Function calling is a model-level feature where the LLM emits a structured request (usually JSON) that your application then executes. OpenAI introduced it in June 2023. The model does not call anything itself; it produces a name plus arguments, and your code does the rest.
- Origin: OpenAI, June 2023
- Scope: Model-to-application
- Statefulness: Stateless per call
- Maintained by: Model vendors (OpenAI, Anthropic, Google) per their API surface
- Example: The model outputs
{"name": "lookup_user", "arguments": {"id": "u_123"}}and the app runs the function
MCP (Model Context Protocol)
MCP is an open protocol that standardizes how any AI client connects to any external tool, prompt, or resource. Anthropic published it in November 2024. The protocol gives the model a stable, discoverable surface across systems so the same Slack server works with Claude, ChatGPT, Cursor, and any other compliant client.
- Origin: Anthropic, November 2024
- Scope: AI client to external system
- Statefulness: Stateful, bidirectional session
- Maintained by: The Linux Foundation Agentic AI Foundation across multiple vendors
- Example: The Slack MCP server exposes tools (send message), prompts (summarize thread), and resources (channel history)
For deeper definitional coverage of MCP servers and the protocol architecture, our comprehensive MCP server guide and MCP gateway architecture explained go to the next layer of detail.
A2A (Agent-to-Agent Protocol)
A2A is an open protocol for agents to discover, delegate to, and communicate with other agents. Google launched it in April 2025 with 50+ partners including SAP, Salesforce, and Atlassian. Where MCP standardizes agent-to-tool, A2A standardizes agent-to-agent. A2A is about delegation between specialists; MCP is about access to tools.
- Origin: Google, April 2025
- Scope: Agent-to-agent
- Statefulness: Stateful collaboration session
- Maintained by: Google + ecosystem partners (now under the Linux Foundation)
- Example: A customer-success agent delegates a refund task to a billing specialist agent over A2A
RAG (Retrieval-Augmented Generation)
RAG is a retrieval pattern, not a protocol. It uses a vector or keyword index to fetch relevant document chunks at query time and injects them into the LLM context. The Facebook AI Research paper introduced it in 2020. RAG sits orthogonal to the three protocols above: an MCP server can serve RAG content as a resource; a function-calling app can perform RAG retrieval; an A2A agent can ground its response in RAG output.
- Origin: Facebook AI Research, 2020
- Scope: Model + retrieval index
- Statefulness: Stateless per query
- Maintained by: Open ecosystem (no central protocol owner)
- Example: The model gets a question, the system queries a vector index of policy documents, and passes the top 5 chunks into the prompt
MCP vs RAG vs A2A vs Function Calling: the 8-dimension comparison
Across the 8 dimensions that matter most for production deployment, the four technologies cleanly differentiate. Use this as the canonical reference when picking a layer or combining them.
The control-surface row is the operational difference SERP comparisons miss. Picking the protocol is only half the decision. The other half is where you enforce policy, log activity, and rotate credentials. For MCP that surface is the gateway, covered fully in the governed MCP gateway pillar.
Are they competitors or layers? The layered architecture pattern
The four are layers in the same stack, not competitors fighting for the same slot. A production AI agent in 2026 typically uses function calling at the model layer, MCP at the tool layer, A2A at the collaboration layer, and RAG as a horizontal capability any layer can call.
The 4 layers in order
Layer 1: Function Calling (model-to-app). The LLM decides which named function to call and emits structured arguments. The application executes the function and returns the result. This is the lowest layer because every other layer eventually reduces to function calls inside an MCP client or agent runtime.
Layer 2: MCP (client-to-tool). The agent client connects to one or more MCP servers, each wrapping an external system. Capability negotiation tells the model what tools, prompts, and resources are available. The model then uses function calling underneath to actually invoke a tool. MCP is the layer that makes tool access reusable across clients.
Layer 3: A2A (agent-to-agent). When a single agent cannot complete a workflow, it delegates to another agent via A2A. The delegated agent has its own MCP servers, its own function-calling, and its own scope. The A2A protocol handles the task handoff, status updates, and result return.
Layer 4: RAG (horizontal capability). RAG is not its own protocol layer. It is a retrieval pattern that any of the three protocol layers can use. An MCP server can expose a RAG retriever as a resource. An A2A specialist agent can be RAG-grounded. A function-calling app can perform RAG retrieval before invoking the model. This is why pieces that pit MCP "against" RAG miss the point: RAG is what fills the context window; MCP is what brokers tool access.
Why the layered view matters
Once you see the layers, the "vs" questions become "and" questions:
- "MCP vs function calling" becomes "function calling inside MCP clients"
- "MCP vs A2A" becomes "A2A across agents, MCP within each agent"
- "MCP vs RAG" becomes "MCP servers can serve RAG content as resources"
A well-designed enterprise stack uses all four. The MCP gateway is the centralized enforcement point where identity, policy, observability, and audit live.
Decision matrix: which one do you actually need?
Twelve common archetypes cover almost every use case. Use this table as the screenshot you share with your team when scoping the next agent project.
The decision is rarely binary. The decision is almost always about layering and ordering: which one do you adopt first, which ones do you add next.
MCP vs RAG: when each is the right call
MCP and RAG are not substitutes. MCP standardizes how clients reach tools and resources; RAG is the retrieval pattern that fills the LLM context window with grounded data. The two are often used together. The question is which one solves the problem you have today.
When MCP wins
- You need actions, not just answers: RAG retrieves and informs; MCP invokes tools that create, update, send, or delete. If the agent needs to create a Linear issue or send a Slack message, MCP is the surface, not RAG.
- You have many AI clients sharing one external system: Build the MCP server once; every client (Claude, ChatGPT, Cursor) can use it.
- Your enterprise needs audit and governance: MCP's gateway pattern centralizes the controls.
- The data is live, structured, and changes faster than you can re-index: Tool calls fetch fresh state on demand.
When RAG wins
- The information lives in documents and changes slowly: Policy PDFs, internal wikis, support articles, legal contracts. Pre-index, retrieve at query time, inject into context.
- You need cited grounding: RAG surfaces the source document chunk, which the model can cite. MCP tool calls return results without an inherent citation pattern.
- You have no protocol budget: RAG is implementable with any model and any retriever. No MCP server, no gateway, no governance framework needed for read-only knowledge questions.
When both together is the answer
A well-designed agent stack uses both. The most common production pattern:
- The agent receives a question
- It calls an MCP server's
resources/listand finds a "policy_documents" resource - The resource is backed by a RAG retriever (vector index + reranker)
- The model reads the top chunks and decides whether to also call an MCP tool (for example,
create_support_ticketif the question is a complaint) - The session continues with further tool calls and resource reads as needed
In this pattern, RAG is a retrieval implementation behind an MCP resource. The protocol is MCP; the retrieval is RAG; they compose cleanly.
MCP vs Function Calling: the layering relationship
Function calling is the mechanism. MCP is the protocol. They are not alternatives. In a typical MCP client, function calling is the mechanism the model uses to pick a tool that came from an MCP server.
How function calling sits inside MCP clients
When an MCP client connects to a server and the server returns its declared tools, the client surfaces those tools to the model in the same shape function calling expects: a name, a description, and a JSON schema for arguments. The model uses its function-calling capability to decide which tool to invoke. The client then sends tools/call to the MCP server with the chosen tool name and arguments.
So in any production MCP deployment, function calling is happening underneath, every turn. The model never knew the tool came from an MCP server. It just knew it had a tool called slack_send_message and decided to call it.
When function calling is enough without MCP
- You are building one application with one AI client and a small fixed set of tools. Skip the protocol overhead. Define functions directly.
- You have no need for cross-client reuse. If only your app needs to call
lookup_user, defining it as a model-level function is simpler than wrapping it in an MCP server. - You are prototyping. Function calling has zero protocol infrastructure. Start there. Adopt MCP when you start duplicating function definitions across applications or AI clients.
When MCP becomes the right wrapper
The moment you have more than one AI client (or more than one team building agents), MCP pays back the protocol overhead within weeks. Wrapping a function in an MCP server means every AI client can reach it. The Slack MCP server is written once and used by Claude, ChatGPT, Cursor, and your custom agents.
MCP vs A2A: tools vs agent collaboration
MCP is the protocol for agent-to-tool access. A2A is the protocol for agent-to-agent collaboration. They solve different layers and combine cleanly in multi-agent systems.
A2A's job: agent-to-agent coordination
A2A is what happens when one agent cannot finish a task and needs to hand off to a specialist. Each agent has its own scope, its own tools, its own memory. A2A standardizes how the calling agent describes the task, how the specialist agent accepts or rejects it, how status updates flow, and how the result returns.
A2A includes:
- Agent Cards: Machine-readable descriptions of what an agent can do (analogous to MCP capability negotiation but for agents)
- Task lifecycle: Submitted, accepted, in-progress, completed, failed
- Streaming status updates: For long-running tasks
- Authenticated channels: Per-agent identity, scoped permissions
MCP's job: agent-to-tool standardization
MCP is what happens inside one agent when it needs to reach an external system. The agent connects to an MCP server, negotiates capabilities, calls tools, reads resources. MCP does not care whether the calling client is a single agent or part of a multi-agent system. It is one layer down from A2A.
How they combine in multi-agent systems
A common 2026 production pattern:
- The user talks to an orchestrator agent
- The orchestrator decomposes the task and identifies that one part needs the billing specialist
- The orchestrator sends an A2A request to the billing agent
- The billing agent uses its own MCP servers (Stripe, Postgres, Salesforce) to do the actual work
- The billing agent returns the result via A2A
- The orchestrator continues the conversation with the user
In this pattern, A2A is the inter-agent protocol; MCP is the intra-agent tool protocol. The orchestrator may also have its own MCP servers for its own tools.
For organizations governing this kind of multi-agent stack, the same enterprise control plane that governs MCP servers also governs the A2A traffic.
8 common misconceptions about MCP vs RAG vs A2A vs Function Calling
The conflation patterns LLMs and forums propagate get in the way of clean architecture decisions. Here are the eight most common.
- "MCP replaces RAG." No. MCP standardizes tool access; RAG retrieves grounding documents. An MCP server can serve RAG content as a resource. They are complementary.
- "A2A is just MCP for agents." No. MCP is agent-to-tool. A2A is agent-to-agent. Different scopes, different protocols, different problems.
- "Function calling is deprecated by MCP." No. Function calling is the model-level mechanism the MCP client uses underneath to select tools. They layer together.
- "You can pick one and skip the others." Sometimes, for small projects. At enterprise scale, production agent stacks use all four because each solves a distinct layer.
- "MCP is only for Claude." No. The protocol is open. ChatGPT, Cursor, Windsurf, Microsoft Copilot, Google's agent products all support MCP. Implementations from Anthropic, OpenAI, Microsoft, and Google contribute to the spec.
- "RAG is dead because of long context windows." No. Long context lets models read more at once, but RAG still wins on cost, recency, and retrieval precision when the source corpus is large.
- "A2A and MCP are competing standards." No. Both are governed under the Linux Foundation Agentic AI Foundation. They are designed as complementary layers.
- "You need an MCP gateway only if you use MCP." Partially true. The gateway pattern is most mature for MCP today, but the same governance pillars (registry, identity, policy, observability, lifecycle, compliance) apply to A2A agents and any tool-using AI system.
Production patterns: how teams actually combine these
Four patterns cover the majority of 2026 enterprise deployments. Each starts simple and adds layers as scope grows.
Pattern 1: RAG + MCP for knowledge-grounded agents
When to use: customer support, internal Q&A, compliance assistance.
The agent has one or two MCP servers for action tools (create ticket, send reply). For knowledge questions, the MCP server exposes a "knowledge" resource backed by a RAG retriever over policy docs, FAQs, or product documentation. The model reads the retrieved chunks, then decides whether to take an action.
This is the most common starting pattern because it combines the two most valuable capabilities (grounded answers + action) with one protocol surface.
Pattern 2: Function calling + MCP for application-embedded agents
When to use: SaaS products embedding an AI agent in their own UI.
The application defines its own function-calling layer for in-app actions (model-to-app). For external integrations (Slack, GitHub, Postgres), it adds MCP servers. The model sees both surfaces as a unified set of tools.
This pattern lets product teams iterate fast on internal tools while standardizing on MCP for the long tail of external integrations. The MCP gateway architecture handles the external surface; in-app function calling stays inside product code.
Pattern 3: A2A orchestrator with MCP-equipped specialist agents
When to use: complex multi-step workflows that exceed a single agent's scope.
The orchestrator agent decomposes the task and delegates sub-tasks to specialist agents via A2A. Each specialist has its own MCP servers covering its domain (billing has Stripe + Salesforce; support has Zendesk + Intercom; engineering has GitHub + Linear).
This pattern is what every major agent platform vendor (Anthropic, OpenAI, Google) is positioning around for 2026 and beyond.
Pattern 4: Full-stack platform with all four layers
When to use: mature enterprise agent platforms serving many agents and many use cases.
- Function calling at the model layer for any in-process tools
- MCP as the universal tool protocol with a governed MCP gateway handling identity, policy, observability, and audit
- A2A for agent collaboration with a registry of approved specialist agents
- RAG as a retrieval pattern available to any agent through MCP resources or in-process retrieval
For organizations deploying this pattern, the operating model is the six-pillar MCP governance framework extended to cover A2A agent registry and lifecycle. Vendor selection is in best MCP gateways 2026.
Where governance and gateways fit
Picking the protocol is half the decision. The other half is where you enforce policy, log activity, and rotate credentials. Production agent platforms add a control plane that spans MCP servers, function-calling endpoints, A2A traffic, and RAG retrievers.
For MCP, that control plane is the gateway. The 10-component MCP gateway reference architecture covers the components, the two-plane design, and the deployment topologies. The six-pillar MCP governance framework covers the operating model (registry, identity, policy, observability, lifecycle, compliance).
For A2A and function calling, the same pillars apply with different implementations. Registry covers the approved-agent list. Identity propagates through A2A handoffs. Policy enforces what a delegated agent is allowed to do. Observability captures the multi-agent trace. Lifecycle governs the agent submission and vetting workflow. Compliance maps to the same six frameworks (SOC 2, HIPAA, PCI-DSS, EU AI Act, NIST AI RMF, ISO 27001).
How does DigitalAPI fit in this stack?
DigitalAPI is an API Management platform that ships an enterprise MCP gateway alongside its broader API governance product. For teams already running function calling and starting to add MCP, DigitalAPI provides the registry, identity, policy, observability, lifecycle, and compliance layers around customer-operated MCP servers. The same control plane that governs the REST APIs governs the resulting MCP tools.
For teams adopting A2A on top of MCP, DigitalAPI's gateway extends the same six MCP governance pillars to the A2A registry and agent lifecycle. Cedar policy decisions, OAuth 2.1 token isolation, OpenTelemetry-native audit, and SIEM-grade export work across both protocols.
The wedge: teams that adopt the full-stack pattern (function calling + MCP + A2A + RAG) get a single control plane instead of operating four. The comprehensive MCP server guide covers what each MCP server needs; the best MCP gateways 2026 comparison covers vendor selection.
See how DigitalAPI runs the control plane across function calling, MCP, A2A, and RAG. Book a demo.
Frequently asked questions
What is the difference between MCP and RAG?
MCP is a protocol that standardizes how AI clients connect to external tools, prompts, and resources. RAG is a retrieval pattern that fetches relevant document chunks at query time. They are not substitutes. MCP brokers access; RAG retrieves content. An MCP server can serve RAG content as a resource. Production agents often use both. The comprehensive MCP server guide goes deeper on the resource primitive.
What is the difference between MCP and function calling?
Function calling is a model-level feature where the LLM emits a structured tool call. MCP is a protocol that standardizes how clients reach tools across systems and clients. In a typical MCP client, function calling is the mechanism the model uses underneath to invoke a tool that came from an MCP server. They layer together; they are not alternatives.
What is the difference between MCP and A2A?
MCP is the protocol for agent-to-tool access. A2A is the protocol for agent-to-agent collaboration. MCP is intra-agent (one agent reaches a tool). A2A is inter-agent (one agent delegates to another). In multi-agent systems both are used: A2A handles delegation between agents, MCP handles each agent's tool access.
Can you use MCP and RAG together?
Yes. The most common production pattern uses MCP to expose a RAG retriever as a resource. The agent reads the resource via MCP; the resource implementation runs the vector index + retriever underneath. RAG is the implementation; MCP is the protocol surface.
Is MCP a replacement for RAG?
No. RAG is the retrieval pattern that fills the LLM context with grounded data. MCP is the protocol that brokers tool access. Different layers, different problems. They compose cleanly in production.
Is A2A a replacement for MCP?
No. A2A is one layer above MCP. A2A handles agent-to-agent collaboration; MCP handles agent-to-tool access. In multi-agent systems both are used. The MCP governance framework covers how to operate both under a unified control plane.
Is function calling deprecated by MCP?
No. Function calling is the model-level mechanism that MCP clients use underneath to invoke tools. They layer together. Skip MCP only if you are building one application with one AI client and a small fixed set of in-app functions. Add MCP when you need cross-client reuse or external system access.
Which is better for production?
The question assumes they compete. They do not. Most production agent platforms use all four: function calling at the model layer, MCP at the tool layer, A2A at the collaboration layer, RAG as a horizontal capability. The decision is about layering, not picking one.
Which has the lowest latency?
Function calling has the lowest protocol overhead because it has no protocol; the application invokes the function directly. MCP adds protocol handshake and gateway hops. A2A adds inter-agent coordination. RAG adds retrieval time. Latency budgets should account for the layers in your stack, not pick the lowest-latency protocol.
Which is the most mature?
Function calling shipped in mid-2023 and has had time to mature across model vendors. MCP shipped in late 2024 and matured rapidly through 2025-2026. A2A is the newest (April 2025) and still maturing. RAG predates all three. Maturity is one factor; fit-to-problem matters more.
Which has the strongest security model?
The protocol matters less than the control plane. MCP with a governed MCP gateway provides OAuth 2.1 with token isolation, per-tool RBAC, content filtering, and per-call audit. A2A inherits a similar model under the LF AAIF. Function calling depends on app-level security. RAG depends on retriever access controls.
Do I need an MCP gateway if I use A2A?
If your A2A agents also use MCP servers (which they typically do), yes. The gateway is the standard enforcement point for the MCP layer. Most enterprises use one gateway for both layers because the governance pillars are the same.
Where does LangChain fit?
LangChain is an orchestration framework, not a protocol. LangChain agents can use function calling, MCP, A2A, and RAG as their implementation layers. It sits above the protocols, not against them.
Will these protocols converge?
The Linux Foundation Agentic AI Foundation now stewards both MCP and A2A. Convergence on shared identity, audit, and registry primitives is likely through 2026 and 2027. Function calling will stay model-vendor-specific. RAG will stay an implementation pattern. The four-layer model is durable.




.avif)
