AgenticBook
Back to Handbook

Chapter 04 · Protocol Guide

MCP, Function Calling, and A2A explained

A clear mental model for the three protocol layers used to connect models, tools, and agents.

01

Function Calling is model-to-tool

The model proposes a structured call; your application remains responsible for execution.

Function calling is the narrowest layer. Your application describes a tool schema, the model returns a name and arguments, and the runtime validates and executes it. It is ideal when the tool is owned by the same application and you need direct control over authorization, retries, and response shaping.

  • Treat the model response as an untrusted request.
  • Validate schema and permissions before execution.
  • Return compact, typed results with enough evidence for the next step.
Editor's takeaway

Function calling is an invocation mechanism, not a complete agent architecture.

02

MCP standardizes tool context

MCP makes tools and resources discoverable across compatible clients and servers.

Model Context Protocol separates the client that hosts the model from a server that exposes tools, resources, and prompts. This reduces bespoke integrations, but it does not remove security responsibility. Operators still need to approve servers, scope credentials, validate outputs, and monitor data leaving the process.

  • Use MCP for reusable integrations shared across clients.
  • Pin server versions and audit capabilities before connecting them.
  • Keep user and tenant authorization in the host application.
Editor's takeaway

MCP is an interoperability layer. It should simplify integration without becoming an unreviewed extension system.

03

A2A connects independent agents

Agent-to-agent communication is a distributed systems problem with an LLM interface.

A2A is useful when separate agents own different capabilities, teams, or trust boundaries. The receiving agent should expose a task contract, status, authentication, deadline, and result schema. Never assume that another agent is correct or available; treat it like an external service with partial failure.

  • Use A2A when ownership or autonomy boundaries are real.
  • Pass correlation IDs, deadlines, and authorization context.
  • Prefer one clear task handoff over an uncontrolled conversation.
Editor's takeaway

Use the smallest protocol that solves the boundary: function calling inside an app, MCP for reusable tools, A2A for independent agents.

Field note

Ship the smallest reliable workflow first. Add autonomy only when your evaluation data shows that it improves outcomes.

More chapters