Skills, MCP, RAG, and AI Agents: How the Core Concepts Fit Together

    Understand how function calling, MCP, RAG, agents, and skills address different layers of LLM application development. This article explains their underlying engineering roles, how they work together, and why interface contracts, decoupling, and reusable capabilities matter more than the terminology.

    1. Beyond the Buzzwords: A Shared Engineering Problem

    LLM application development comes with a growing vocabulary: agents, function calling, MCP, RAG, and skills. For many developers, the challenge is understanding how these concepts relate. Are they distinct technologies, or different names for the same thing?

    Strip away the terminology, and a common theme emerges: most of these concepts address how large language models interact with external systems through defined engineering contracts.

    A contract specifies the data formats and interaction flows that participants agree to follow. Developers already know this idea from frontend–backend API integration. In LLM applications, familiar interface-design principles appear in a new setting.

    That shared foundation does not make these concepts interchangeable. Each addresses a different layer of the application.

    2. Function Calling: Making Model Output Parseable

    2.1 The Problem: Natural Language Is Difficult to Process Reliably

    LLMs naturally generate text. In an agent application, however, code must often process the model’s response to:

    • Determine whether the model is requesting a tool call.
    • Extract the tool name and arguments.
    • Execute the tool and return its result to the model.

    Natural language is flexible and ambiguous. Parsing a sentence such as “I want to check tomorrow’s weather in Beijing” requires intent detection and pattern-matching logic that can become brittle and difficult to maintain.

    This resembles a familiar integration problem: a frontend cannot reliably process arbitrary prose from a backend. The usual solution is an agreed structured format, such as JSON.

    2.2 The Solution: A Structured Output Contract

    Function calling uses prompting or native model support to make tool-call requests follow a defined structure, typically represented as JSON:

    1. {
    2. "tool": "get_weather",
    3. "arguments": {
    4. "city": "Beijing",
    5. "date": "tomorrow"
    6. }
    7. }

    Application code can parse this structure with a standard JSON library and extract the required fields without interpreting a free-form sentence.

    At its core, function calling applies an interface contract to communication between a model and tool-execution code. The model expresses the requested action, while the application handles execution.

    2.3 Important Limitations

    • Structured output does not, by itself, demonstrate that a model understands a tool. It shows that the model can generate a request that follows a specified format.
    • Tool descriptions affect how reliably the model selects the appropriate tool and supplies suitable arguments.
    • Production applications still need validation and retry mechanisms because model output may occasionally violate the expected contract.

    3. MCP: Decoupling Tools from the Agent

    3.1 The Next Problem: Tight Coupling

    Function calling addresses how the model expresses a tool request. It does not, on its own, solve tool integration.

    When tool logic is embedded directly in agent code, adding or changing tools requires changes to the agent. Moving to another agent framework may also require rewriting the integration layer.

    This is a standard software-engineering problem: tight coupling.

    3.2 The Solution: Separate Tool Providers and a Shared Protocol

    The conventional response is to decouple tools from the agent and expose their capabilities through separate services. That introduces new questions: how does the agent discover available tools, understand what they do, and invoke them?

    A shared protocol needs to define:

    1. Tool discovery: how tools make their availability known.
    2. Capability descriptions: tool names, descriptions, and parameter schemas.
    3. Invocation and results: how calls are submitted and responses are returned.

    This is the role of protocols such as MCP, the Model Context Protocol, in tool integration.

    The underlying idea resembles interface specifications in web development: standardize the capability catalog and interaction methods so compatible agents and tool providers can work together without bespoke integration for every pairing.

    3.3 MCP and Function Calling Operate at Different Layers

    MCP and function calling are complementary, not substitutes:

    • Function calling addresses how a model expresses its intent and arguments for an individual tool call. It is the contract between the model and application code.
    • MCP addresses how tool capabilities are discovered, reused, and integrated across systems. It is a system-to-system protocol.

    MCP provides the discovery and invocation layer. When the model requests a particular tool action, a structured-output mechanism still provides the model-side representation of that request.

    4. RAG: Retrieving Knowledge Before Generating an Answer

    RAG, or retrieval-augmented generation, addresses a different problem: a model’s training data cannot cover all private enterprise information or continuously changing knowledge.

    Putting every relevant document into the prompt is also impractical because of context-length and cost constraints.

    A typical RAG workflow has three stages:

    1. Offline preparation: Split documents into chunks, generate vector representations, and store them in a vector database or retrieval service.
    2. Online retrieval: When a user asks a question, generate a vector representation of the query and retrieve relevant passages.
    3. Answer generation: Supply the retrieved passages as context alongside the user’s question so the model can generate an answer grounded in that material.

    The basic principle is retrieve first, answer second—similar to consulting documentation before responding to an unfamiliar question.

    In practice, chunking strategy, retrieval quality, and reranking are major determinants of RAG performance. The generation model alone does not determine the quality of the system.

    5. Agents and Skills: Combining and Reusing Capabilities

    An agent brings these capabilities together around an LLM-driven decision process.

    In this architecture, the model can:

    • Express actions through function calling.
    • Access external tools through protocols such as MCP.
    • Use RAG to obtain relevant private knowledge.
    • Continue through a perception–planning–execution–observation loop.

    The agent is therefore more than a single model response: it coordinates decisions, actions, and feedback.

    A skill can be understood as a packaged, reusable capability. It may bundle instructions, tools, and an execution workflow into a unit that an agent loads when needed.

    At this higher level, the contract defines how a capability is described, triggered, and executed. The emphasis shifts from invoking individual tools to reusing an organized capability.

    6. A Practical Map of the Concepts

    The distinctions become clearer when viewed as layers of an application:

    Concept Problem It Addresses Underlying Mechanism
    Function calling Model output is difficult to parse Structured output and an interface contract
    MCP Tools are tightly coupled to agents Decoupled tool providers and a discovery/invocation protocol
    RAG The model lacks private or current knowledge Retrieval and context injection
    Agent A single conversational turn is insufficient for a task A planning–execution–observation loop
    Skill Capabilities are difficult to reuse Capability packaging and description conventions

    These concepts are not magic. They apply familiar software-engineering principles to LLM applications: agree on formats, decouple components, and package capabilities for reuse.

    Understanding those principles makes new terminology easier to evaluate. Rather than asking whether a new protocol or framework replaces everything that came before it, ask which layer it operates at and which engineering problem it solves.