Resources, Prompts, Completion, Pagination and Caching
Resources are application-driven context addressed by URIs; prompts are user-controlled message templates; completion helps users fill in prompt and template arguments. Around them sit the list utilities every primitive shares: opaque-cursor pagination and the `ttlMs`/`cacheScope` caching hints added in 2026-07-28. Know the control model, the exact error codes, and how caching interacts with notifications and authorization.
Key points
- 1
Control model: tools are model-controlled, resources are application-driven (the host decides what to attach), prompts are user-controlled (the user picks them, often as slash commands). User-controlled is about who triggers a prompt; the server writes its content.
- 2
Resources have a unique RFC 3986 URI, a
name, and optionaltitle,description,mimeType,sizeand icons.resources/readreturnscontentsitems withuri,mimeTypeand eithertextor base64blob, and MAY return several items (for example a directory's files). - 3
Resource templates (
resources/templates/list) use RFC 6570 URI templates such asusers://{id}/profileto expose families of resources without enumerating them.{var}percent-encodes/;{+var}keeps it, which suits multi-segment paths. - 4
Use
https://only when the client can fetch the resource directly; otherwise use another scheme or a custom one that follows RFC 3986.file://resources need not map to a real filesystem, and servers MAY use XDG types likeinode/directory. - 5
Annotations on resources, templates and content blocks:
audience(userand/orassistant),priority(0.0 to 1.0, 1 = effectively required) andlastModified(ISO 8601). They are hints for filtering, prioritising and sorting, not access control. - 6
Resource not found is
-32602in 2026-07-28 (was-32002; clients SHOULD still accept it). Servers MUST NOT return an emptycontentsarray for a missing resource, and SHOULD use-32603for internal errors. Servers MUST validate URIs and sanitisefile://paths against traversal. - 7
A tool can return a
resource_link(a pointer the client may read later, not necessarily inresources/list) or an embeddedresource(contents inline). Link large or optional content; embed small content that is needed right away. - 8
Per-resource change notifications in 2026-07-28: open
subscriptions/listenwith URIs inresourceSubscriptions(server capabilityresources.subscribe) and receivenotifications/resources/updated. This replacesresources/subscribefrom 2025-11-25.list_changednotifications only signal membership changes. - 9
Prompts:
prompts/listreturns name, title, description andarguments(name, title, description, required).prompts/getreturnsmessageswith roleuserorassistantand one content block each (text, image, audio, resource link or embedded resource). Missing required arguments or an unknown name give-32602. - 10
completion/completetakes aref(ref/promptby name orref/resourceby URI or template), theargumentbeing typed andcontext.argumentswith earlier choices. Results hold up to 100values, an optionaltotalandhasMore. The server declarescompletions; servers SHOULD rank and rate limit, clients SHOULD debounce. - 11
Pagination for
tools/list,prompts/list,resources/listandresources/templates/listuses an opaquecursor/nextCursor; the page size is the server's choice; a missingnextCursorends the list, while an empty string is a valid cursor. Invalid cursors SHOULD get-32602. - 12
Caching:
server/discover, the four list methods andresources/readMUST carryttlMs(>= 0) andcacheScope(publicorprivate). The key is the method plus the relevant parameters;input_requiredresults and MRTR retries are never cached; a missing or negative TTL means stale; notifications invalidate fresh entries; private caches MUST NOT cross authorization contexts.
Common traps
Calling
resources/subscribeon a 2026-07-28 server: subscriptions moved tosubscriptions/listenwithresourceSubscriptions.Returning or checking for an empty
contentsarray to mean not found; use-32602(accept-32002from older servers).Treating
""as the end of pagination, or parsing cursors as offsets; cursors are opaque and only a missingnextCursorends the list.Marking per-user list or read results
cacheScope: "public": shared gateways may serve them to other users, andcacheScopenever replaces access control.Using
ttlMsas a polling interval; it is a freshness hint checked on access, and any polling MUST use jitter and backoff.Confusing
hasMore(completion results) withnextCursor(list pagination).Assuming read-only data must be a resource: if the model has to decide when to fetch it, a read-only tool is the reliable choice.
Treating prompt inputs as trusted because prompts are user-controlled; implementations MUST validate prompt inputs and outputs against injection and unauthorized access.
Read the source
Further reading
Suggest a resourceNo extra reading for Resources, Prompts, Completion, Pagination and Caching yet. Found a guide, video or cheat sheet that made it click? Share it and help the next learner.
Test yourself on Resources, Prompts, Completion, Pagination and Caching
Ten questions, with the answer and explanation after each one.