MCP is often introduced as a standard way for an AI application to call tools. That is true, but it leaves out an important part of the design: MCP also defines how applications provide context, how servers ask for additional input, and how clients keep people in control.
This article follows one idea through the protocol: who decides what information enters the model’s context, and what happens when an MCP server needs more information before it can finish a request?
We will cover tools and resources, then prompts, sampling, and roots. We will finish by tracing a complete tool call, including a multi-round-trip request where the server pauses to ask the user a question.
The examples use the MCP specification revision 2026-07-28. That revision changes some older patterns, so examples from earlier MCP versions may look different.
Table of contents
- The MCP roles: host, client, server, and model
- Tools: actions the model can request
- Tool results and error handling
- Resources: information the application can provide
- Resource change notifications
- Prompts: user-selected conversation templates
- Sampling: asking the client to run a model
- Roots: indicating a workspace
- Multi-round-trip requests
- A complete example: “What is 5 plus 7?”
- What to remember
1. The MCP roles: host, client, server, and model
An MCP interaction can involve four parts:
- The user asks a question or makes a choice.
- The host application is the AI app the user interacts with.
- The MCP client is the part of the host that communicates with an MCP server.
- The MCP server provides tools, resources, or prompts.
- The model is accessed by the host through a model provider’s API.
The client is normally a component inside the host. They are shown separately here because they do different jobs: the host manages the user experience and model conversation; the client speaks MCP.
The model and MCP server do not normally communicate directly. The host coordinates their work:
- The host gives the model a question and a description of available tools.
- The model may ask the host to call a tool.
- The host’s MCP client sends that request to a server.
- The host gives the result back to the model.
- The model responds to the user.
The model does not execute the tool. It produces a structured request. The host decides how to handle that request and whether to ask the user for confirmation.
2. Tools: actions the model can request
A tool represents an action, such as searching a database, looking up a flight, or creating a calendar event.
Tools are commonly called model-controlled because the model can select one based on the user’s request. The protocol does not require a particular interface, however. A host might also show tools in a menu or require confirmation before running them.
A server advertises tools through tools/list. Each tool includes a name, description, and input schema. The schema describes the arguments the tool accepts.
For example, a server might advertise this tool:
{
"name": "add_numbers",
"description": "Add two numbers",
"inputSchema": {
"type": "object",
"properties": {
"a": { "type": "number" },
"b": { "type": "number" }
},
"required": ["a", "b"]
}
}
The host can translate that definition into the format expected by its model provider. The model sees the tool description and schema, then may produce a request such as:
{
"name": "add_numbers",
"arguments": {
"a": 5,
"b": 7
}
}
The host’s MCP client turns that into a tools/call request for the server.
Tools can also include annotations such as readOnlyHint, destructiveHint, idempotentHint, and openWorldHint. These are guidance for the host. For example, a host could use destructiveHint to decide whether to show a confirmation prompt. The annotations do not themselves enforce behavior; the host and server still need to implement the appropriate safeguards.
3. Tool results and error handling
A tool result may contain more than plain text. Its content field is a list of typed blocks. Depending on the result, those blocks can contain text, images, audio, links to resources, or resources embedded directly in the response.
For example, a tool could return a sentence and structured data:
{
"resultType": "complete",
"content": [
{
"type": "text",
"text": "Flight AA123 costs $412."
}
],
"structuredContent": {
"flight": "AA123",
"price_usd": 412
},
"isError": false
}
The host can show the text to the model while also using structuredContent to render a flight card or populate a user interface.
A tool failure can be reported in two different ways.
A tool execution error
The server understood the request and attempted the tool, but the operation failed. It returns a normal result with isError: true and an explanation:
{
"resultType": "complete",
"content": [
{
"type": "text",
"text": "The departure date must be in the future."
}
],
"isError": true
}
The host can pass this message to the model as the tool’s result. The model may then correct its arguments and try again.
A protocol-level error
A protocol-level error means the request could not be handled as a valid MCP request. For example, the JSON-RPC message may be malformed, or it may name a method the server does not support. The response has an error object instead of a normal result.
A useful question is: Can the model fix the problem by changing the tool call? If the server ran the tool and can explain how to correct the input, a tool result with isError: true lets the host show that explanation to the model. Protocol errors are for failures in handling the request itself.
The 2025-11-25 revision introduced SEP-1303, which changed how invalid tool arguments are reported. For current behavior, don’t assume that every bad argument should become a JSON-RPC -32602 error. Check the rules for the protocol revision and SDK you are implementing.
4. Resources: information the application can provide
A resource is information identified by a URI. It could represent a file, a database schema, a document, or another piece of application data.
Resources are commonly described as application-controlled. This means the host decides how to present them and when to include their contents as context. For example, the host might:
- Show a resource picker so the user can select a file.
- Let the user search or filter a resource list.
- Automatically include a resource based on the current project or conversation.
MCP defines the resource operations, but does not require one particular user interface.
A server can list available resources with resources/list. The client can request a resource’s contents with resources/read. A resource may contain text or binary data.
A server can also provide resource templates. A template describes a pattern of resource URIs, such as:
file:///logs/{service}/{date}.log
That pattern is useful when a server has many possible resources and listing every URI individually would be impractical.
List results may be paginated. A nextCursor is a bookmark indicating that another page is available. When there is no nextCursor, the client has reached the end of the list.
Resource caching
In the 2026-07-28 revision, resource and list results include caching hints:
-
ttlMssays how long the result may be treated as fresh, in milliseconds. -
cacheScopesays whether the cached result is public or private to an authorization context.
For example:
{
"resultType": "complete",
"resources": [],
"ttlMs": 300000,
"cacheScope": "public"
}
This says that a client may treat the result as fresh for five minutes and that it may be shared within the public cache scope. A private result must not be shared in a way that exposes one user’s data to another.
The server provides the hints; the client or a gateway decides whether and how to cache the result. A cache can avoid repeated network requests for data that has not changed.
5. Resource change notifications
A client may need to learn that a resource changed. Without notifications, it could repeatedly poll the server by calling resources/read on a timer.
Earlier MCP versions used resources/subscribe and resources/unsubscribe for individual resource subscriptions. In the 2026-07-28 revision, those methods are replaced by subscriptions/listen.
The client opens a listening stream and specifies the notification types it wants. These may include changes to the tools, prompts, or resources lists, and updates to specific resource URIs. The server acknowledges the subset it accepts. Later notifications tell the client that something changed; the client can then fetch the updated list or resource content.
The distinction is:
- A resource update means the content at a particular URI changed.
- A list-changed notification means the catalog of available resources changed, for example because a resource was added or removed.
This lets the server send a small signal instead of pushing the full resource contents every time something changes.
6. Prompts: user-selected conversation templates
A prompt is a reusable template that a server offers to the user. A code-review prompt, for example, might ask for a security-focused review and include fields for the code and programming language.
The server can list prompts with prompts/list. The host can show that list in a menu or another interface. When the user chooses a prompt and supplies its arguments, the host calls prompts/get.
A prompt returns messages, not merely a string:
{
"description": "Code review",
"messages": [
{
"role": "user",
"content": {
"type": "text",
"text": "Review this file for bugs:"
}
},
{
"role": "user",
"content": {
"type": "resource",
"resource": {
"uri": "file:///src/math.py",
"mimeType": "text/x-python",
"text": "def add(a, b): return a - b"
}
}
}
]
}
The message structure allows the prompt to include roles and different content types, such as text and resources. The host can add those messages to the conversation it sends to the model.
Prompts are often called user-controlled because the user chooses them. This is a useful way to understand their role, although the protocol does not require a specific prompt-picker interface.
7. Sampling: asking the client to run a model
Sampling is the mechanism by which an MCP server asks the client to generate a model response. For example, a server processing a large set of commit messages might ask the client to summarize them.
The idea is that the client already manages the model provider, credentials, and user permissions. The server can ask for a completion without holding its own provider API key.
A sampling request can include messages, a system prompt, a token limit, and model preferences. Those preferences may contain suggested model names and priorities for cost, speed, or intelligence.
They are hints, not commands. The server cannot assume which providers or model names the client supports, so the client decides how—or whether—to fulfill the request.
Sampling also has privacy and cost implications. The client should be able to review or deny a request and should apply its own policies before sending data to a model.
Current status: Sampling is deprecated in the 2026-07-28 specification. Existing implementations may continue to support it during the deprecation period, but new implementations are advised to call the model provider’s API directly. When sampling is used with the 2026-07-28 protocol, the request is carried through the multi-round-trip mechanism described below.
8. Roots: indicating a workspace
Roots represent directories or files that a client considers relevant to a server, such as the project folder open in an editor.
A root can help a server focus its work. For example, a filesystem tool might receive the URI of the project folder rather than guessing which directory the user means.
Roots are advisory. They communicate scope, but MCP does not enforce filesystem permissions. A server process that has operating-system permission to read other files may still be able to do so. Real access limits must be enforced through operating-system permissions, restricted mounts, containers, or other isolation.
Current status: Roots are deprecated in the 2026-07-28 specification. New designs should generally pass paths through tool arguments, resource URIs, or server configuration. If roots are used with the current protocol, the server requests them through the multi-round-trip pattern.
9. Multi-round-trip requests
In earlier protocol designs, a server could send a request back to the client while the client’s request was still being processed. That required a live connection and a route back to the right client. This can be awkward in systems with load balancers or stateless server instances.
The 2026-07-28 protocol uses Multi-Round-Trip Requests (MRTR) for interactions that need client input. Instead of calling the client in the middle of a request, the server returns an input_required result. The client handles the requested input, then retries the original operation with the response.
A simplified sequence looks like this:
- The client sends a request, such as
tools/call. - The server replies with
resultType: "input_required", the input it needs, and optionallyrequestState. - The client handles the input request, perhaps by asking the user or running an approved model request.
- The client retries the original operation with
inputResponsesand the originalrequestState. - The server completes the operation and returns
resultType: "complete".
requestState is continuation data from the server. It allows the server to resume work on the next round. The client treats it as opaque: it returns the value without relying on or editing its contents.
_meta has a different purpose. It provides request metadata, such as the protocol version and client capabilities. A request can carry _meta without needing another round trip. If another round is needed, the response may include requestState as well.
So the short distinction is:
-
_metadescribes the request and client. -
requestStatecarries the server’s continuation data between rounds of one unfinished operation.
MRTR can be used with tools, prompts, and resources. A server must only request input that the client has declared it can provide. For elicitation, the server asks the client to collect information from the user, commonly through a form or URL flow.
10. A complete example: “What is 5 plus 7?”
Suppose a user asks an AI application:
What is 5 plus 7?
An MCP server exposes an add_numbers tool. For illustration, this version of the tool also asks the user whether the result should be an integer or decimal.
Step 1: The host checks its tool cache
The host needs to know which tools are available before it can offer them to the model. It checks its local cache for a previously fetched tool list.
On the first request, the cache is empty. The client must call tools/list. On later requests, the host may reuse a still-fresh cached list, subject to its scope and the server’s cache hints.
The cache belongs to the client or host, not the server. It can contain tool names, descriptions, and schemas previously returned by the server.
Step 2: The client lists tools
The client calls tools/list. The server returns the add_numbers description and schema. It may also return ttlMs and cacheScope hints that tell the client how long and under what scope it may reuse the list.
Step 3: The host gives the model the tool definition
The model provider usually has its own format for tool definitions. The host translates the MCP tool description into that format and sends it along with the user’s question.
The model sees the question and the tool schema. It does not directly contact the MCP server.
Step 4: The model proposes a tool call
The model responds with a structured request to call add_numbers with a: 5 and b: 7.
The host remembers the model provider’s tool-call identifier so it can attach the eventual tool result to the correct request.
Step 5: The client calls the MCP tool
The client sends a tools/call request to the server. The request includes the tool name and arguments. In the current protocol, each request also carries required metadata in _meta, including the protocol version and client capabilities.
With Streamable HTTP, selected request metadata may also be mirrored into HTTP headers. This lets infrastructure inspect or route a request without parsing the JSON body. The body remains the source of truth, and the transport defines how mismatches are handled.
Step 6: The server asks for user input
The server can perform the addition, but in this example it needs the user to choose the output format. It returns resultType: "input_required" with an elicitation request and a requestState value.
The host displays a question such as:
Integer or decimal result?
The user selects “integer.” The model does not need to answer this question; it is a request for user input.
Step 7: The client retries the original request
The client sends the original tools/call again, including the user’s answer in inputResponses. It also returns the server’s requestState unchanged and includes request metadata again.
The retry is a new MCP request, so it has its own JSON-RPC request ID. The ID matches that request to its response. The server uses the returned continuation state and the user’s response to finish the operation.
Step 8: The host returns the result to the model
The server responds with resultType: "complete" and the result “12.” The host associates that result with the model provider’s original tool-call identifier and sends it back to the model in the provider’s expected format.
The model then replies to the user:
5 plus 7 is 12.
What the example shows
The example includes three separate exchanges:
- User and host: the user asks a question and answers the format prompt.
- Host and model provider: the host sends the question and tool definition, then later sends the tool result.
- MCP client and server: the client lists tools and calls the server, including a retry when the server needs input.
The host coordinates these exchanges. It translates between the provider’s tool format and MCP, handles the user interaction, and decides what information to pass back to the model.
11. What to remember
- Tools describe actions the model may request. The host still controls how and whether those actions run.
- Resources identify information the host may provide as context. The host decides how to expose and include it.
- Prompts are reusable message templates that users can select.
- Sampling lets a server request a model completion through the client, but it is deprecated in the 2026-07-28 revision.
- Roots indicate relevant files or directories, but do not enforce access control and are also deprecated.
- MRTR lets a server ask for additional input without making a mid-request callback to the client.
-
_metaandrequestStateare different:_metadescribes the request and client;requestStatecarries the server’s continuation data when an operation needs another round. - A cache is a saved client-side copy. Cache hints describe when it may be reused and whether it can be shared.
MCP’s design becomes easier to follow when each feature is tied to the decision it supports: who chooses an action, who chooses context, who selects a reusable prompt, and who controls access to user input and model calls.
Top comments (0)