AgenticBook
Back to Handbook
Chapter 04 · Protocol GuideIssue 02 · November 2026

MCP, Function Calling, and A2A: boundaries and safe integration

Three related but different layers: a model can request an application tool, an MCP client can connect to reusable capabilities, and one independent agent can hand a task to another.

Protocol boundary decision table

Protocol boundary decision table
LayerWhat it standardizesUse it when
Function CallingA model response that names a tool and supplies structured arguments.Your application owns tool schemas, execution, authorization, and result handling.
MCPA client/server protocol for discovering and invoking tools and resources.You want reusable capabilities across compatible clients; the host still owns trust and authorization.
A2ACommunication and task handoff between independent agent applications.Agents cross team, runtime, or trust boundaries and need discovery, task status, or streaming.

01

Function Calling: the application executes the request

Structured tool output is still untrusted input from a model.

The application gives the model a tool schema; the model proposes a call; server code validates the request, checks the user’s permissions, executes the operation, and returns a bounded result. This is a good fit for tools owned by the same product because your code controls the whole authorization and error path. It is not a protocol for discovering tools across independent processes, nor does it provide agent-to-agent identity by itself.

  • Validate arguments against a server-owned schema and allowlist.
  • Derive tenant and user identity from the authenticated request, never from model arguments.
  • Return typed success and error outcomes so the model can recover safely.
Editor's takeaway

Function Calling is a model-to-application invocation pattern; the runtime remains responsible for execution.

02

MCP: reusable capabilities with an explicit trust boundary

MCP makes tools and resources portable between compatible clients and servers; it does not make a server trustworthy by default.

An MCP client connects to an MCP server that advertises capabilities such as tools, resources, and prompts. This can remove one-off integration code, but operators must still approve the server, constrain credentials, validate outputs, and decide which data may leave the process. The official MCP servers repository explicitly labels its maintained implementations as reference examples—not production-ready solutions.

  • Use MCP when multiple clients should share a well-defined capability server.
  • Review server source, permissions, network access, and secret handling before connecting it.
  • Keep tenant authorization and business policy in the host application.
Editor's takeaway

MCP standardizes the connection; your security model still determines what the connection is allowed to do.

03

A2A: tasks between independent agents

Agent-to-agent interoperability is a distributed-systems boundary, not just another tool call.

The A2A project describes a protocol for separate agent applications to discover capabilities and collaborate without exposing their internal memory or tools. Its repository describes Agent Cards, JSON-RPC over HTTP(S), synchronous and streaming exchanges, and asynchronous task updates. The receiving agent is still an external dependency: it can be slow, unavailable, misconfigured, or return an incomplete result.

  • Use A2A when the other agent is independently operated or has its own trust boundary.
  • Pass correlation IDs, authentication context, deadlines, and a bounded task contract.
  • Validate the returned result and preserve a human escalation path for consequential work.
Editor's takeaway

Use the smallest layer that fits: function calling inside an application, MCP for reusable capabilities, and A2A for independent agents.

Primary sources

First-party repositories and documentation used for this chapter. Check the upstream README and release notes before implementation.

More chapters