Zenaique

MCP has tools, resources, and prompts. What makes a resource different from a tool?

Flashcard·Easy·4.0 · 0·~30s·Asked atAccentureUniphoreVoyage Ai·Relevant atAnthropic
Attempt it
TL;DR

A resource is read only, URI identified data that the host (not the model) pulls and injects into context. Tools are model invoked and may have side effects; resources inform without acting.

Memory aid
Sign in to see the mnemonic that makes this stick.
Easy to grasp

Think of the AI app as someone with a library card. The librarian (the MCP server) keeps a catalog of documents, each with a unique address like a call number. When the app decides the model needs to see a document, the app goes to the librarian and asks for it. The model never walks to the shelves itself; only the app does. And nothing the app does to a document changes it: there is no write back, no edit, no delete. Resources are how MCP lets a server share read only context with the model without giving the model the keys to modify anything. Files, database rows, web pages, log snippets: any blob of data that should be read but never changed through this channel can be a resource.

Concept explanation~2 min read

Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.

A resource is the MCP primitive for read only data. It sits alongside tools (which act) and prompts (which the user invokes) in the three primitive model the protocol defines. Of the three, resources are the most often confused because they look superficially like tools but behave very differently in practice.

This deep dive walks through what a resource is, the URI based identification scheme, the JSON-RPC methods that operate on resources, the host pull invocation model, the subscription pattern, and how resources differ from tools in design intent. By the end you should be able to look at a real world capability and confidently decide whether it should be a tool or a resource.

The definition, unpacked

A resource is a piece of read only data the server exposes to the host, identified by a URI, that the host can pull and inject into the model's context.

Four load bearing pieces sit in that definition. Read only means resources have no write operation by protocol design. The server returns content; nothing in the resource API modifies the underlying data. Server exposed means resources are declared by the server and advertised through the standard JSON-RPC methods; clients discover them via resources/list. URI identified means each resource has a unique URI (a file path, a database reference, a web URL, a server specific scheme); the URI is how clients and servers refer to the data. Host pulled means the host (not the model) decides when to fetch a resource and what to do with the content.

The contrast with tools is sharp on every axis. Tools have flat names; resources have URIs. Tools are model invoked; resources are host pulled. Tools may have side effects; resources are strictly read only. The asymmetry is intentional: the two primitives exist because read only data and side effecting actions deserve different invocation patterns and different policy gates.

URI based identification and URI templates
The three JSON-RPC methods: list, read, subscribe
Host pull versus model invoke: why the asymmetry matters
Real world resource examples and how they fit
Sign in to unlock the full deep dive.

Situations where this technique stops working.

Sign in to see when this approach fails.

2–4 min · Everything important, quickly.

Sign in to see the quick scan of the deep dive.

Real products, models, and research that use this idea.

  • Filesystem server exposes files under configured roots as `file:///path` resources; the host can read any file the server is allowed to see and inject it into conversation context.
  • Postgres and SQLite servers expose table contents as `postgres://` resources, often using URI templates for browsing schemas and tables without listing every row.
Sign in to see more production examples.

What an interviewer would ask next. Try answering before peeking at the approach.

QWhy are resources host pulled and not model invoked?
A

Two reasons. First, it keeps the model from accidentally exfiltrating data it should not have access to; the host applies policy before injecting any resource content. Second, it matches a common UX pattern where the host or user decides which context to include based on application logic, not based on the model guessing the user's intent.

2 more follow-ups an interviewer would ask next. Sign in to reveal them.

Red flags & common mistakes

The phrases that signal junior thinking. Click to expand.

Most common mistake

Believing the model invokes resources directly. The host pulls resources and decides when to inject the content; the model only sees what the host chose to include.

Sign in to see all red flags and common mistakes.

60 second bullets to scan on the way to the call.

  • Define an MCP resource using the read only and host pulled framing

  • Name the identification scheme used for resources (URIs)

Sign in to unlock the revision sheet.

Primary sources. Browse if you want the original framing.

Similar questions

Same topic, related formats. Practice these next.

4 curated
Next question
What is the Model Context Protocol (MCP) and what problem does it solve?
MCQ·Easy