Module 4
19 min read

Tools and the Model Context Protocol

Tools are how an agent touches the world, and the Model Context Protocol (MCP) is how most agents now find and call them. This module goes from the mechanics of a single tool call to the protocol's biggest rewrite yet, the stateless 2026-07-28 specification.

How function calling works

A model can't run code, open a URL or query a database. What it can do is write text, and function calling (also called tool use) is a convention for writing a very particular kind of text: a structured request to run a named tool with specific arguments. Your code, the harness, does the actual work.

  1. 1

    Describe

    You send the model a list of tools along with the conversation. Each tool has a name, a plain-language description, and a JSON Schema for its inputs.

  2. 2

    Decide

    The model reads the descriptions and decides whether a tool would help. If so, it returns a tool call: the tool's name plus JSON arguments that match the schema. It can also return several calls at once.

  3. 3

    Execute

    Your harness validates the arguments, runs the real function, and captures the output or the error.

  4. 4

    Return

    You send the result back to the model, linked to the original call by an ID. The model continues: another tool call, or a final answer.

{
  "name": "search_orders",
  "description": "Search a customer's orders. Use this before answering any question about order status, refunds or delivery. Returns at most 20 orders, newest first.",
  "input_schema": {
    "type": "object",
    "properties": {
      "customer_email": {
        "type": "string",
        "description": "The customer's email address, exactly as given."
      },
      "status": {
        "type": "string",
        "enum": ["pending", "shipped", "delivered", "refunded"],
        "description": "Optional filter. Omit to return all statuses."
      },
      "since": {
        "type": "string",
        "format": "date",
        "description": "Only orders placed on or after this date (YYYY-MM-DD)."
      }
    },
    "required": ["customer_email"]
  }
}
A tool definition in the shape used by Anthropic's Messages API (input_schema). OpenAI's APIs use a similar JSON Schema under a parameters field.

Everything in that definition is read by the model, so everything is a prompt. The description says when to use the tool and what it returns; the enum stops the model from inventing a status like "in transit"; the date format tells it exactly how to write dates. The model's choice of tool and arguments is only as good as these words.

Designing tools agents can use well

Anthropic's guidance on agents puts it simply: invest as much effort in the agent-computer interface as you would in a human-computer interface. A badly designed tool causes failures that look like the model being dumb, when really the model was given an ambiguous or overloaded interface.

Fewer, higher-level tools

Don't wrap every API endpoint. A single schedule_meeting tool that checks availability and books the slot beats three low-level calls the model has to chain correctly.

Unambiguous names

Namespace related tools (github_create_issue, jira_create_issue) so the model can tell them apart, especially when many MCP servers are connected at once.

Concise, relevant results

Return what the model needs to decide its next step, not raw dumps. Paginate or truncate large outputs, and say so in the result so the model knows more exists.

Errors that teach

"Invalid date" is weak. "since must be YYYY-MM-DD, got 'last Tuesday'" lets the model fix its own call on the next turn.

Hard-to-misuse inputs

Use enums, required fields and absolute paths instead of free text and relative paths. Make the wrong call impossible where you can.

Test with the model

Run real tasks and read the transcripts. Where the agent misuses a tool, fix the description or the interface, then test again.

Write descriptions for a smart new hire

Imagine a capable colleague who has never seen your system. What would they need to know to use this tool correctly the first time? When to use it, when not to, what the fields mean, and what the output looks like. That is the description.

MCP: one protocol for tools and data

Before MCP, every agent framework had its own way to define tools, and every integration had to be rewritten for each one. Anthropic released the Model Context Protocol in November 2024 to fix that. MCP defines a standard way for an AI application to discover and use capabilities from external servers, so a GitHub or Postgres integration written once works in any MCP-compatible agent. In December 2025 Anthropic donated MCP to the Linux Foundation's Agentic AI Foundation (AAIF), where it is now governed alongside other agent standards.

  • The host is the AI application the user interacts with, such as Claude, ChatGPT, VS Code, Cursor or goose.
  • Inside the host, an MCP client manages the connection to one server.
  • An MCP server exposes capabilities. It can run locally (over stdio) or remotely over HTTP.

Servers offer three core primitives. The difference between them is who decides when they are used, which is a useful design question for any capability you expose.

PrimitiveControlled byWhat it isExample
ToolsThe modelFunctions the model can call, with input (and optionally output) schemascreate_issue, run_query, send_message
ResourcesThe applicationRead-only data addressed by URI that the host can attach as contextA file, a database schema, a log stream
PromptsThe userReusable prompt templates, often surfaced as slash commands/summarize-pr, /draft-release-notes

MCP tools can also carry annotations, added in the 2025-03-26 revision, that hint at their behavior: whether a tool is read-only, destructive, idempotent, or reaches out to the open world. Hosts use these hints to decide which calls need user approval. They are hints, not guarantees, so a host should only trust them from servers it trusts.

How the spec evolved

MCP versions are named by date. Each revision tells you what problem the community was hitting at the time: first remote access and auth, then richer interaction, then long-running work, and finally scale.

RevisionHighlights
2024-11-05Initial release by Anthropic: tools, resources and prompts over JSON-RPC
2025-03-26OAuth 2.1 authorization; Streamable HTTP transport replaces HTTP+SSE; tool annotations
2025-06-18Elicitation; structured tool output (outputSchema and structuredContent); resource links; MCP servers classified as OAuth resource servers
2025-11-25One-year anniversary release: experimental Tasks for durable, pollable long-running requests; Client ID Metadata Documents (CIMD) preferred for client registration; URL-mode elicitation
2026-07-28 (current)Stateless core, Multi Round-Trip Requests, header-based routing, cacheable lists, formal extensions (Tasks, MCP Apps, Enterprise Managed Authorization), and deprecation of Roots, Sampling and Logging
MCP specification revisions. Details for 2025-03-26 come from a secondary timeline.

The 2026-07-28 stateless redesign

The maintainers call 2026-07-28 "the largest revision in the standard's history". The release candidate was locked on May 21, 2026, and the final spec shipped on July 28. The motivation was operational. Earlier versions assumed a long-lived session between one client and one server process, which made MCP servers awkward to scale behind load balancers or run on serverless platforms.

Stateless core

The initialize / initialized handshake and the Mcp-Session-Id header are gone. Every request carries the protocol version, client identity and capabilities in its _meta field, so any server instance can handle any request.

Multi Round-Trip Requests (MRTR)

These replace server-initiated requests that needed an open stream. If a server needs more input, it returns a result marked input_required, and the client retries the request with inputResponses attached.

Header-based routing

Requests carry Mcp-Method and Mcp-Name headers, so gateways, rate limiters and logs can route and meter traffic without parsing JSON bodies.

Cacheable lists

Results of tools/list, prompts/list, resources/list and resources/read can include ttlMs and cacheScope, so clients stop re-fetching definitions that rarely change.

// 1. Client calls a tool
{ "method": "tools/call",
  "params": { "name": "book_room", "arguments": { "date": "2026-11-03" } } }

// 2. Server needs a decision before it can finish
{ "result": {
    "resultType": "input_required",
    "inputRequests": { "room": { "message": "Two rooms are free. Which one?",
                                 "options": ["Oak", "Pine"] } } } }

// 3. Client retries the same call with the answer attached
{ "method": "tools/call",
  "params": { "name": "book_room", "arguments": { "date": "2026-11-03" },
              "inputResponses": { "room": "Oak" } } }
Simplified illustration of an MRTR exchange. Only resultType, input_required and inputResponses come from the spec summary; other field names are placeholders.

The revision also formalized an extensions framework. Three features became official extensions rather than core spec: Tasks (long-running work, now with poll-based tasks/get and a new tasks/update), MCP Apps (interactive UIs, below) and Enterprise Managed Authorization (EMA), aimed at organizations that want MCP access governed through their own identity and authorization systems.

Finally, it deprecated Roots, Sampling and Logging, with a minimum 12-month window before removal, and the legacy HTTP+SSE transport. TypeScript, Python, Go and C# SDKs are Tier 1, and Rust is in beta.

Why statelessness matters for agent-to-agent systems

When thousands of agents call shared tool servers, those servers have to scale like ordinary web services. A stateless protocol can run on round-robin load balancers and serverless functions, which Google highlighted as a key benefit for agent infrastructure. If you maintain an MCP server, check the official migration guidance before upgrading.

Elicitation, structured output and MCP Apps

Three features added since mid-2025 make tools more interactive and easier for agents to rely on.

  • Elicitation (2025-06-18) lets a server ask the user for input partway through an operation, with a schema describing what it needs, such as a confirmation or a choice between options. The user can accept, decline or cancel. This brings human-in-the-loop into the tool itself. URL-mode elicitation (2025-11-25) sends the user to a web page for flows that should never pass through the model, like a payment or an OAuth login.
  • Structured tool output (2025-06-18) lets a tool declare an outputSchema and return machine-readable structuredContent alongside the usual text. Agents and hosts can validate and use the data directly instead of parsing prose.
  • MCP Apps launched on January 26, 2026 as the first official MCP extension. A tool can return an interactive UI that renders in a sandboxed iframe inside the host, such as a chart, a form, or a design canvas. Claude, VS Code Insiders and goose supported it on day one, ChatGPT later that week, with partners including Asana, Figma, Slack, Canva, Box and Salesforce.

Never route secrets through the model

If a tool needs a password, card number or API key from the user, use URL-mode elicitation or a separate auth flow. Anything that enters the model's context can end up in logs, summaries or, in the worst case, an attacker's hands through prompt injection.

Authorization, the registry and trust

Remote MCP servers often act on a user's behalf: reading their email, filing tickets in their workspace. MCP uses standard OAuth 2.1 for this, and the details have tightened with each revision.

ConceptWhat it means
MCP server as resource serverSince 2025-06-18, a server validates access tokens issued by a separate authorization server, like any OAuth-protected API
CIMDClient ID Metadata Documents: a client identifies itself with a URL pointing to a metadata document. Preferred since 2025-11-25
Dynamic Client RegistrationThe older way for clients to register on the fly. Deprecated in favor of CIMD in 2026-07-28
Issuer validation (RFC 9207)Required in 2026-07-28: the client checks which authorization server issued a response, blocking mix-up attacks
Bound credentialsCredentials are tied to the authorization server that issued them, so a malicious server can't replay them elsewhere
Enterprise Managed AuthorizationAn official extension for organizations that want MCP authorization managed centrally rather than server by server

To find servers, there is an official MCP Registry, which secondary sources say reached general availability in September 2025. Third-party trackers estimate tens of thousands of listed servers by October 2026, most of them remote HTTP endpoints, though those counts have not been checked against the registry itself.

An MCP server is code you are trusting

In September 2025, a package called postmark-mcp became the first known malicious MCP server: it silently BCC'd every email it sent to an attacker. Connecting a server gives it a voice in your agent's context and access to whatever its tools can reach. Prefer servers from known publishers, pin versions, review permissions, and grant the narrowest scopes possible. Module 11 covers this in depth.

Scaling up: tool search, and where MCP stops

Connect ten MCP servers with twenty tools each and you have two hundred tool definitions, potentially tens of thousands of tokens, in context before the agent does anything. That wastes the attention budget from Module 3 and makes the model more likely to pick the wrong tool. The fix is the same progressive disclosure idea behind Agent Skills: tool search, also called deferred tool loading. The agent starts with a search tool and a short index, and loads the full definitions only for the few tools it actually needs.

MCP is excellent at one thing: letting an agent use capabilities it controls. A tool does what it is told and returns. But some of the most interesting work in 2026 involves delegating to things that are not tools at all, such as another company's agent with its own model, data, judgment and hours-long tasks. That is a different relationship, and it has its own protocol.

MCP (vertical)A2A (horizontal)
ConnectsAn agent to tools and dataAn agent to other agents
The other side isA capability the agent controlsAn opaque peer with its own reasoning and state
Unit of workA tool call, or a Task for long jobsA task with messages and artifacts, often long-running
Discoverytools/list on a connected server; the MCP RegistryAgent Cards published at a well-known URL
GovernanceAAIF (since Dec 2025)Linux Foundation; joined AAIF Aug 2026

The two are complementary, not competing. A typical system uses MCP inside each agent to reach its tools, and A2A between agents to share work. Module 5 opens Track 2 with A2A: how agents discover each other through Agent Cards, how tasks, messages and artifacts flow between them, and what changed in version 1.0.

Key takeaways

  • Function calling is the model writing a structured request; your harness executes it and returns the result. Every name, description and schema field is part of the prompt.
  • Good tools are few, high-level, clearly named, return concise results, and produce errors the model can learn from.
  • MCP standardizes how agents reach tools (model-controlled), resources (application-controlled) and prompts (user-controlled), and is now governed by the AAIF.
  • The 2026-07-28 spec made MCP stateless, with Multi Round-Trip Requests, header routing, cacheable lists, an extensions framework, and deprecation of Roots, Sampling and Logging.
  • Treat MCP servers as trusted code: use OAuth 2.1 with CIMD, narrow scopes, and known publishers.
  • MCP is vertical (agent to tools); A2A is horizontal (agent to agent). Real systems use both.

Sources & further reading