What Are AI Agents? A Complete Guide to LLMs, Function Calls, MCP & A2A
This article explains the core concepts behind AI agents—including how they differ from large language models, their relationship to workflows, the various agent operating modes, and the underlying technologies such as function calls, the Model Context Protocol (MCP), Skills, and the Agent‑to‑Agent (A2A) protocol—providing clear examples and practical comparisons for developers and interviewees.
LLM vs. Agent
To understand agents you first need to know what a Large Language Model (LLM) is. An LLM is a "super‑smart" model trained on massive text data that predicts the next token, enabling it to generate fluent prose, code, translations, and answers.
LLMs have four major limitations:
They can only talk but cannot act on external systems.
They have no persistent memory across conversations.
They cannot use tools such as search engines, APIs, or databases.
They cannot plan or break a complex task into steps.
An Agent solves these problems by wrapping an LLM with a loop that enables tool use, memory, and planning. In simple terms, an LLM is a consultant that only gives advice, while an Agent is a project manager that can execute the advice.
Agent vs. Workflow
A workflow is a pre‑defined sequence of steps coded by a developer. The LLM is only called at specific points. An Agent decides the next step itself, making the process dynamic.
Key differences:
Control : Workflow control lies in code; Agent control lies in the LLM.
Cost : Workflows consume about a quarter of the tokens an Agent does because they avoid repeated reasoning.
Reliability : Workflows are predictable; Agents are flexible but harder to debug.
In practice most production systems use a hybrid architecture where a workflow orchestrates the overall pipeline and an Agent handles the unpredictable parts.
Agent Working Modes
Agents can operate in several patterns:
1. ReAct (Reason + Act)
The classic loop: Thought → Action → Observation → Thought … The agent thinks, calls a tool, observes the result, and repeats until the goal is met. This mode is transparent and flexible but can be token‑heavy.
2. Plan‑and‑Execute
The agent first creates a full plan, then executes it step‑by‑step without re‑reasoning at each step. This reduces token usage (about 20 % of ReAct) but is less adaptable to unexpected changes.
3. Reflection
After completing a task the agent reviews its own output, optionally iterating until satisfied. Two implementations exist: self‑reflection (single agent switches to reviewer role) and dual‑agent review (a second agent critiques the first).
4. Multi‑Agent
Complex tasks are split among specialized agents (planner, researcher, coder, tester). Frameworks such as LangGraph, CrewAI, OpenAI Agents SDK, and Microsoft AutoGen support this pattern, though premature use is discouraged.
Function Call
Function Call lets an LLM request the execution of an external function. The workflow is:
Define the function schema (name, description, JSON parameters).
The model decides whether a function is needed and which one.
The application executes the function and returns the result.
The model incorporates the result into its final answer.
Function Call turns a pure text generator into a decision engine that can retrieve real‑time data, perform actions, and avoid hallucinations.
Model Context Protocol (MCP)
MCP is a unified "USB‑C"‑style protocol for connecting agents to external tools. Instead of writing N×M adapters for N agents and M services, each agent implements an MCP client once, and each service provides an MCP server once.
Key components:
MCP Host : the AI application (e.g., Claude Desktop, Cursor).
MCP Client : runs inside the host and translates tool requests.
MCP Server : exposes a tool (e.g., GitHub search, Slack messaging) via a standard API.
The host discovers available servers, queries their capabilities, and calls tools through a common JSON format, making tool integration scalable.
Skills
Skills are natural‑language instruction files (usually SKILL.md) that encode domain expertise and procedural knowledge. They tell an agent "what to do" in a given scenario, including which tools may be used.
Typical structure:
---
name: Code_Review_Expert
description: Triggered when a user asks for code review.
triggers:
- "review this code"
- "code review"
---
# Identity
You are a senior backend architect with 10 years of experience.
# Review workflow
1. Check structure …
2. Look for security issues …
3. Suggest performance improvements …
# Output format
Provide a concise markdown report.Skills act like a "cookbook" that pairs with the "kitchen" (MCP) to let an agent perform expert tasks without hard‑coding the logic.
Agent‑to‑Agent (A2A) Protocol
A2A, announced by Google in 2025, standardizes communication between agents. It defines:
Agent Card : a JSON description of an agent’s capabilities, identity, and authentication requirements.
Task : a lifecycle object (created, in‑progress, completed, failed) that one agent can assign to another.
Message & Artifact : data exchanged during a task, supporting text, images, audio, and structured data.
A2A handles horizontal collaboration (agent‑to‑agent) while MCP handles vertical integration (agent‑to‑tool). Together they form a layered protocol stack:
Function Call – basic tool invocation.
MCP – standardized agent‑to‑tool connectivity.
A2A – standardized agent‑to‑agent collaboration.
Putting It All Together
The article walks through eight core questions, summarizing the ecosystem:
LLMs are powerful text generators but lack action, memory, tool use, and planning.
Agents augment LLMs with those missing capabilities.
Workflows are code‑driven pipelines; agents are LLM‑driven.
Agents support multiple operating modes (ReAct, Plan‑and‑Execute, Reflection, Multi‑Agent).
Function Call is the foundational API that lets LLMs request external actions.
MCP standardizes how agents discover and call tools across services.
Skills provide reusable domain knowledge and procedural guidance.
A2A enables agents to discover each other, assign tasks, and exchange results.
Understanding these layers helps developers design scalable, maintainable AI systems that can both act autonomously and cooperate with other agents.
IT Services Circle
Delivering cutting-edge internet insights and practical learning resources. We're a passionate and principled IT media platform.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
