Skip to main content
Account

A Resource Is Just an Address

I read an incident with resources/read instead of a tool call and look at who decides to read it. Based on spec version 2026-07-28.

Stefan Ruzitschka 13 min read

Last time I looked at the incident INC-101 with a tool call. The same server has resources too, and at the end I promised to read the incident that way. A resource is data a server offers for reading. Each one has a URI, and I’ll call that its address.

It’s the same incident and the same server, so I wondered why there’s a second way to read it. The table of primitives in the first part said the host decides which resources to use, and for tools it’s the model. I want to see what that looks like in the requests.

A list of addresses

I download the server into a new folder and start it, like before.

Terminal window
demo_dir=$(mktemp -d "${TMPDIR:-/tmp}/mcp-demo.XXXXXX") &&
cd "$demo_dir" &&
curl -fsSLo oncall.ts https://raw.githubusercontent.com/rawkode-academy/rawkode-academy/main/content/examples/mcp-oncall/server.ts
Terminal window
deno run oncall.ts

It’s a new process, so INC-101 and INC-102 are open again and nobody has acknowledged them. I ask what resources the server has:

{"jsonrpc":"2.0","id":1,"method":"resources/list","params":{"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientInfo":{"name":"by-hand","version":"0.1.0"},"io.modelcontextprotocol/clientCapabilities":{}}}}
resources/list response (names and descriptions trimmed)
{
"result": {
"resources": [
{ "uri": "oncall://schedule", "title": "On-call schedule", "mimeType": "application/json" },
{ "uri": "runbook://api", "title": "Runbook for api", "mimeType": "text/markdown" },
{ "uri": "runbook://checkout", "title": "Runbook for checkout", "mimeType": "text/markdown" },
{ "uri": "runbook://search", "title": "Runbook for search", "mimeType": "text/markdown" },
{ "uri": "graph://api/error-rate", "title": "5xx rate of api", "mimeType": "image/png" },
{ "uri": "incident://INC-101", "title": "INC-101: p99 latency above 2s", "mimeType": "application/json" },
{ "uri": "incident://INC-102", "title": "INC-102: 5xx rate at 4%", "mimeType": "application/json" }
],
"resultType": "complete",
"ttlMs": 0,
"cacheScope": "private"
},
"jsonrpc": "2.0",
"id": 1
}

There are seven resources, and every one has a URI. The scheme is the part before ://. This server made up four of them. That’s allowed as long as it’s a valid URI. The spec also names https://, file:// and git://.

The two open incidents from last time are in the list. The list also has things no tool gave me, the schedule, a runbook per service and a graph.

Reading one

Now I read INC-101 with resources/read. Besides _meta the request has only the URI:

{"jsonrpc":"2.0","id":2,"method":"resources/read","params":{"uri":"incident://INC-101","_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientInfo":{"name":"by-hand","version":"0.1.0"},"io.modelcontextprotocol/clientCapabilities":{}}}}
resources/read response
{
"result": {
"contents": [
{
"uri": "incident://INC-101",
"mimeType": "application/json",
"text": "{\n \"id\": \"INC-101\",\n \"service\": \"checkout\",\n \"title\": \"p99 latency above 2s\",\n \"severity\": \"sev2\",\n \"status\": \"open\",\n \"acknowledgedBy\": null,\n \"timeline\": [\n \"alert fired: p99 latency above 2s\"\n ]\n}"
}
],
"resultType": "complete",
"ttlMs": 0,
"cacheScope": "private"
},
"jsonrpc": "2.0",
"id": 2
}

For comparison I paste the tool call from last time right after it.

{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"get_incident","arguments":{"id":"INC-101"},"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientInfo":{"name":"by-hand","version":"0.1.0"},"io.modelcontextprotocol/clientCapabilities":{}}}}
tools/call response
{
"result": {
"content": [
{
"type": "text",
"text": "{\n \"id\": \"INC-101\",\n \"service\": \"checkout\",\n \"title\": \"p99 latency above 2s\",\n \"severity\": \"sev2\",\n \"status\": \"open\",\n \"acknowledgedBy\": null,\n \"timeline\": [\n \"alert fired: p99 latency above 2s\"\n ]\n}"
}
],
"resultType": "complete"
},
"jsonrpc": "2.0",
"id": 3
}

The text is the same in both. The wrapper is different. The tool gave me content, a list of blocks for a model. The resource gives me contents, with an s. Each entry has the URI it belongs to, the data and a MIME type like application/json, if the server knows one. It’s a list because one read may return several entries. This server always returns one.

The read request has no tool name and no arguments. A resource has no hints like destructiveHint either. It’s meant to be data to read, but like the hints that’s only what the server says. The protocol doesn’t stop a server from doing more in a read.

Not every resource is text. This is the entry I get for graph://api/error-rate, and I shortened the value:

The entry from the resources/read response (blob trimmed)
{
"uri": "graph://api/error-rate",
"mimeType": "image/png",
"blob": "iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQ..."
}

It has a blob where the text was. That’s a small PNG in base64, because JSON can’t carry raw bytes. An entry has either text or blob, and that’s how a client tells them apart.

Who reads

Last time I had to play the model to call a tool. For these requests I didn’t. That’s what the table in the first part meant. A tool call starts with the model, which sees the tool’s description and decides to call it. A resources/read is meant to start with the host. The spec calls resources application-driven and leaves it to the host how they get into the conversation.

Say I’m looking at INC-101 in my coding agent and I attach the runbook for checkout to my question. The host reads it for me:

{"jsonrpc":"2.0","id":4,"method":"resources/read","params":{"uri":"runbook://checkout","_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientInfo":{"name":"by-hand","version":"0.1.0"},"io.modelcontextprotocol/clientCapabilities":{}}}}
resources/read response
{
"result": {
"contents": [
{
"uri": "runbook://checkout",
"mimeType": "text/markdown",
"text": "# checkout\n\n1. Check p99 latency of the payment provider.\n2. If the provider is slow, switch on the queue fallback.\n3. If it isn't, look at the last deployment of checkout.\n"
}
],
"resultType": "complete",
"ttlMs": 60000,
"cacheScope": "public"
},
"jsonrpc": "2.0",
"id": 4
}

Then the host does what it did with the tool result in the first part. It takes the text out of contents and puts it into its request to the model. I can’t capture that request in my terminal, and how a host wraps the text is up to the host. It could look like this:

Request to the model API (messages only)
[
{
"role": "user",
"content": [
{
"type": "text",
"text": "runbook://checkout\n\n# checkout\n\n1. Check p99 latency of the payment provider.\n2. If the provider is slow, switch on the queue fallback.\n3. If it isn't, look at the last deployment of checkout.\n"
},
{
"type": "text",
"text": "What do I check first for INC-101?"
}
]
}
]

There is no MCP in this request, like in hop 2 of the first part. There’s also no tool call in it. In the first part the incidents got into the conversation because the model asked for them, and that took a second request to the model. The runbook is there from the start, because I picked it.

So the model doesn’t have to see resources/list at all. One host shows you a picker and you attach a resource to your prompt. Another could add what looks useful on its own, or let the model choose from the list. That’s still the host’s choice. The host only needs the URI for all of that. It can show the URI to you, keep it and read the resource again later.

Here are the two ways to get INC-101 next to each other.

tools/call with get_incidentresources/read
Who starts itThe modelThe host, often because you picked something
What goes inA tool name and argumentsA URI
What comes backcontent, blocks for the modelcontents, each with its URI and a MIME type
How long it’s good forThe reply doesn’t sayttlMs and cacheScope

The last row is in the two reads above. The incident came with ttlMs: 0 and cacheScope: "private". An incident can change at any time, so the server says the answer is stale right away. The runbook came with ttlMs: 60000 and cacheScope: "public". It’s the same for everyone and rarely changes. Both values are hints for caches. A server still has to check who’s asking.

Support differs a lot today. In Claude Code you type @ and pick a resource, and it gets attached to your prompt. Claude Code also gives the model tools to list and read resources, so there the model can read one too. The difference that stays is that a tool only runs because a model asked for it. A resource has an address, and whoever has the address can read it.

When I build a server, I’d offer as a resource what a person might want to attach, and as a tool what the model should fetch on its own. For a runbook that’s both.

That has a catch though. Whatever is in the runbook ends up in front of the model, also text that reads like an instruction, and nobody approved it the way I’d approve a tool call. Which resources go in without asking is again the host’s decision. The same goes for a resource with an https:// URI. The spec asks servers to use that scheme only when the client could fetch it from the web on its own. Then the host makes a request to an address the server picked.

One kind of error

Last time there were two kinds of errors. get_incident answered INC-7 with isError: true in a normal result, so the model could read what went wrong and try again. A read result has no isError. Every failure here is a protocol error, and the host gets it and decides what to do with it.

This is the same incident that doesn’t exist:

{"jsonrpc":"2.0","id":6,"method":"resources/read","params":{"uri":"incident://INC-7","_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientInfo":{"name":"by-hand","version":"0.1.0"},"io.modelcontextprotocol/clientCapabilities":{}}}}
resources/read error
{
"jsonrpc": "2.0",
"id": 6,
"error": {
"code": -32602,
"message": "Resource not found: incident://INC-7",
"data": {
"uri": "incident://INC-7"
}
}
}

The tool’s error had advice for the model in it. This one has the URI again, for the host. The spec doesn’t allow an empty contents list for a missing resource. It has to be this error.

I write the address myself

The list had only the two open incidents. The server has a resolved one too, INC-98. list_incidents only shows it with status set to all. I read it anyway:

{"jsonrpc":"2.0","id":7,"method":"resources/read","params":{"uri":"incident://INC-98","_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientInfo":{"name":"by-hand","version":"0.1.0"},"io.modelcontextprotocol/clientCapabilities":{}}}}
The text from the resources/read response
{
"id": "INC-98",
"service": "search",
"title": "index lag above 10 minutes",
"severity": "sev3",
"status": "resolved",
"acknowledgedBy": "kim",
"timeline": [
"alert fired: index lag above 10 minutes",
"acknowledged by kim",
"resolved: indexer restarted"
]
}

So it’s a resource, and it isn’t in the list. There’s a second list for that, resources/templates/list. It’s for resources a server describes with a pattern and doesn’t list one by one.

{"jsonrpc":"2.0","id":8,"method":"resources/templates/list","params":{"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientInfo":{"name":"by-hand","version":"0.1.0"},"io.modelcontextprotocol/clientCapabilities":{}}}}
resources/templates/list response
{
"result": {
"resourceTemplates": [
{
"name": "incident",
"uriTemplate": "incident://{id}",
"title": "Incident",
"description": "One incident with its timeline, by its ID (for example incident://INC-101). Changes when somebody acknowledges or resolves it.",
"mimeType": "application/json"
}
],
"resultType": "complete",
"ttlMs": 3600000,
"cacheScope": "public"
},
"jsonrpc": "2.0",
"id": 8
}

A resource template is a URI with holes in it. The syntax is from RFC 6570. Every incident is a resource, open or not. For the ones that aren’t in the list I have to write the address myself.

That’s how a server with a million rows can offer each one as a resource. It lists a few, or none, and gives the pattern for the rest. It also means that leaving something out of the list hides nothing. The read is where a server has to check if I’m allowed to see it.

When a resource changes

An incident can change at any time. A host that put INC-101 into a conversation would like to know when it does. It could read the incident every few seconds, or it can subscribe.

Earlier versions had a resources/subscribe request for that. In 2026-07-28 there’s one method for all the change notifications a client wants, subscriptions/listen. I ask for changes to the list and to INC-101:

{"jsonrpc":"2.0","id":9,"method":"subscriptions/listen","params":{"notifications":{"resourcesListChanged":true,"resourceSubscriptions":["incident://INC-101"]},"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientInfo":{"name":"by-hand","version":"0.1.0"},"io.modelcontextprotocol/clientCapabilities":{}}}}
Notification
{
"jsonrpc": "2.0",
"method": "notifications/subscriptions/acknowledged",
"params": {
"notifications": {
"resourcesListChanged": true,
"resourceSubscriptions": ["incident://INC-101"]
},
"_meta": {
"io.modelcontextprotocol/subscriptionId": 9
}
}
}

This line has no id, so it’s a notification like the progress ones last time. The server acknowledges the subscription and repeats what it agreed to. The subscription ID is the ID of my request. The request itself gets no result. It stays open for as long as the subscription lasts.

Now something has to change. Last time I acknowledged INC-101, and I send that call again, into the same terminal:

{"jsonrpc":"2.0","id":10,"method":"tools/call","params":{"name":"acknowledge_incident","arguments":{"id":"INC-101","by":"icepuma"},"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientInfo":{"name":"by-hand","version":"0.1.0"},"io.modelcontextprotocol/clientCapabilities":{}}}}

Two lines come back. The second is the tool result, INC-101 acknowledged by icepuma. This is the first:

Notification
{
"jsonrpc": "2.0",
"method": "notifications/resources/updated",
"params": {
"uri": "incident://INC-101",
"_meta": {
"io.modelcontextprotocol/subscriptionId": 9
}
}
}

Besides the subscription ID the notification has only the URI. The new content isn’t in it. If I want it, I paste my resources/read line for INC-101 again, and then acknowledgedBy is icepuma.

Then I acknowledge the other incident:

{"jsonrpc":"2.0","id":11,"method":"tools/call","params":{"name":"acknowledge_incident","arguments":{"id":"INC-102","by":"icepuma"},"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientInfo":{"name":"by-hand","version":"0.1.0"},"io.modelcontextprotocol/clientCapabilities":{}}}}

Only the tool result comes back, INC-102 acknowledged by icepuma. I didn’t subscribe to that one.

The list changes too

The list is the other thing I subscribed to. It changes when an incident is opened, and there’s a tool for that.

{"jsonrpc":"2.0","id":12,"method":"tools/call","params":{"name":"open_incident","arguments":{"service":"search","title":"queries time out","severity":"sev2"},"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientInfo":{"name":"by-hand","version":"0.1.0"},"io.modelcontextprotocol/clientCapabilities":{}}}}

Again two lines come back. The first is a notification:

Notification
{
"jsonrpc": "2.0",
"method": "notifications/resources/list_changed",
"params": {
"_meta": {
"io.modelcontextprotocol/subscriptionId": 9
}
}
}

That’s what listChanged in the discovery answer was about last time. It doesn’t say what changed either. The client asks for the list again, and mine now has eight entries. The same request covers the tool list I skipped last time, with toolsListChanged.

The second line is the tool result:

tools/call response
{
"result": {
"content": [
{
"type": "text",
"text": "INC-103 opened"
},
{
"name": "INC-103",
"uri": "incident://INC-103",
"mimeType": "application/json",
"type": "resource_link"
}
],
"resultType": "complete"
},
"jsonrpc": "2.0",
"id": 12
}

Last time I listed what a block in a tool result can contain, and two of them were a link to a resource and an embedded resource. This is the first one. A resource link is a block of type resource_link. It has the URI and not the data. A search tool can return twenty of them. The host, or the model if the host gives it a tool to read resources, then reads only the ones it needs. A linked resource doesn’t have to be in resources/list.

The other one is the embedded resource, a block of type resource with the URI and the data in it. The prompt in the next part returns two of those.

To end the subscription on stdio a client sends a notification with the ID of the listen request. A notification isn’t a request, so it doesn’t need the _meta block.

{"jsonrpc":"2.0","method":"notifications/cancelled","params":{"requestId":9}}

Nothing comes back. I acknowledge INC-101 once more, with dana as by, and get only the tool result this time. I press Ctrl-D on a blank line.

A server I didn’t write

Like last time I paste some of these lines into the filesystem server. I start it in the demo folder, in the same terminal.

Terminal window
npx -y @modelcontextprotocol/server-filesystem@2.3.0 .

The discovery line from last time goes first, because I want to see what this server supports:

{"jsonrpc":"2.0","id":60,"method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientInfo":{"name":"by-hand","version":"0.1.0"},"io.modelcontextprotocol/clientCapabilities":{}}}}

For resources the answer has "resources": { "listChanged": true }. Then I paste my resources/list line, and the list is empty. oncall.ts is in that folder and the server doesn’t list it. That’s on purpose. The allowed folder could be my whole home directory, and the server doesn’t go through all of it to build a list.

My resources/templates/list line returns one template, file://{+path}. The + means slashes in the value stay slashes. So every file in the allowed folder is a resource, and this server expects me to write every address myself. I write one for a file outside the folder:

{"jsonrpc":"2.0","id":63,"method":"resources/read","params":{"uri":"file:///etc/hosts","_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientInfo":{"name":"by-hand","version":"0.1.0"},"io.modelcontextprotocol/clientCapabilities":{}}}}
resources/read error
{
"jsonrpc": "2.0",
"id": 63,
"error": {
"code": -32602,
"message": "Access denied - path outside allowed directories: /etc/hosts not in /tmp/mcp-demo.A1B2C3"
}
}

I shortened the path. Last time the tool of this server refused the same file with isError: true. The resource refuses it with a protocol error, with the same text in it. So the limit applies to the resource as well.

Then the subscription, for the list and that file:

{"jsonrpc":"2.0","id":64,"method":"subscriptions/listen","params":{"notifications":{"resourcesListChanged":true,"resourceSubscriptions":["file:///etc/hosts"]},"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientInfo":{"name":"by-hand","version":"0.1.0"},"io.modelcontextprotocol/clientCapabilities":{}}}}
Notification
{
"jsonrpc": "2.0",
"method": "notifications/subscriptions/acknowledged",
"params": {
"notifications": {
"resourcesListChanged": true
},
"_meta": {
"io.modelcontextprotocol/subscriptionId": 64
}
}
}

The file isn’t in the acknowledgment. This server doesn’t have subscribe in its capabilities, so it dropped that part of my request without an error. So a client should check the acknowledgment to know what it will get. I won’t get anything for the part it did accept either. Its list is always empty, and listChanged is just what the SDK it’s built with sets by default.

I press Ctrl-D.

The same over HTTP

Over HTTP the server answers a listen request with a stream and keeps it open. I start the oncall server with --http in the same terminal and leave it running. It’s a new process again, so the incidents are back to how they started.

Terminal window
deno run --allow-net=127.0.0.1:3001 oncall.ts --http

In a second terminal I send the same listen request. -N makes curl print the events as they arrive.

Terminal window
curl -sS -N http://127.0.0.1:3001/mcp \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-H 'MCP-Protocol-Version: 2026-07-28' \
-H 'Mcp-Method: subscriptions/listen' \
-d '{"jsonrpc":"2.0","id":50,"method":"subscriptions/listen","params":{"notifications":{"resourcesListChanged":true,"resourceSubscriptions":["incident://INC-101"]},"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientInfo":{"name":"by-hand","version":"0.1.0"},"io.modelcontextprotocol/clientCapabilities":{}}}}'
Response
event: message
data: {"jsonrpc":"2.0","method":"notifications/subscriptions/acknowledged","params":{"notifications":{"resourcesListChanged":true,"resourceSubscriptions":["incident://INC-101"]},"_meta":{"io.modelcontextprotocol/subscriptionId":50}}}

curl keeps the stream open. Deno prints the request.signal warning from last time in the server’s terminal. In a third terminal I acknowledge INC-101.

Terminal window
curl -sS http://127.0.0.1:3001/mcp \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-H 'MCP-Protocol-Version: 2026-07-28' \
-H 'Mcp-Method: tools/call' \
-H 'Mcp-Name: acknowledge_incident' \
-d '{"jsonrpc":"2.0","id":51,"method":"tools/call","params":{"name":"acknowledge_incident","arguments":{"id":"INC-101","by":"icepuma"},"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientInfo":{"name":"by-hand","version":"0.1.0"},"io.modelcontextprotocol/clientCapabilities":{}}}}'

The tool result arrives in the third terminal. In the second one, which is still listening, a new event shows up.

Response, continued
event: message
data: {"jsonrpc":"2.0","method":"notifications/resources/updated","params":{"uri":"incident://INC-101","_meta":{"io.modelcontextprotocol/subscriptionId":50}}}

On stdio everything shared one connection. Here the change came in with one request and the notification went out on another. That’s the usual case. Somebody else acknowledges the incident, and my host hears about it.

In the first part I wrote that a server doesn’t have to remember anything about the client between two requests. A subscription is the one place where this server keeps something about me, and only as long as the stream is open. There’s still no session. With several instances behind a load balancer, they’d have to pass such changes on to each other.

Then I read the incident in the third terminal.

Terminal window
curl -sS -i http://127.0.0.1:3001/mcp \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-H 'MCP-Protocol-Version: 2026-07-28' \
-H 'Mcp-Method: resources/read' \
-H 'Mcp-Name: incident://INC-101' \
-d '{"jsonrpc":"2.0","id":52,"method":"resources/read","params":{"uri":"incident://INC-101","_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientInfo":{"name":"by-hand","version":"0.1.0"},"io.modelcontextprotocol/clientCapabilities":{}}}}'

Mcp-Name carried the tool name last time. For resources/read it carries the URI, so a gateway can route or filter reads by resource without parsing the body. The server compares the two like it did for the tool name. A gateway can filter on the header, but the server still has to do its own access check.

I end the subscription with Ctrl-C in the listening terminal. Over HTTP, closing the stream is how a client cancels. A stream can’t be resumed. After a lost connection a client sends subscriptions/listen again, with a new ID. Whatever changed in between isn’t sent later, so it reads the resource again.

I’d have a server refuse a subscription to a resource the caller couldn’t read. The notification has no content, but it still says that something changed and when.

Not every host subscribes yet. The docs for building Claude connectors list resource subscriptions under the features Claude doesn’t support.

I stop the server with Ctrl-C in its terminal and remove the demo folder there.

Terminal window
cd ~ && rm -r "$demo_dir"

What’s next

I left out a few things here too. Long lists come in pages. A client can ask the server to complete the values for a template. A server can answer a read with a question back, like resolve_incident did last time. And resources can have annotations. They have the same name as the hints from last time but have nothing to do with them. They say who a resource is for, how important it is and when it last changed.

So a resource is an address with text or bytes behind it, and the host decides when to read it. If the server supports subscriptions, the host can also hear when it changed.

One row of the table from the first part is still left. Prompts are the ones you pick yourself. The oncall server has one that writes an incident update, and next time I’ll ask for it and see what comes back.

Published

Related articles

Rawkode Academy newsletter

Academy publications by email

Get an email when Rawkode Academy publishes new tutorials, articles, and videos.

Loading email signup. If it does not load, manage email preferences in account settings.