Resources, prompts and tools
medium 6 minResources supply addressable data, prompts supply reusable message templates, and tools describe operations.
Read the manual, borrow the recipe, ring the till.
At a shop, a manual supplies facts, a recipe supplies a reusable procedure, and ringing the till performs a transaction.
Video lesson · Chapter 1 of 4
The catalogue in the wrong employee's pocket
Theory
Read or listen first. About 2 min.
What it is
Resources supply addressable data, prompts supply reusable message templates, and tools describe operations. Choose the primitive by its contract: reading a manual, preparing a review prompt, and reserving physical inventory have different effects. Discovery tells a client what is offered. Each invocation still needs the applicable permissions and parameter checks.
Why it exists
The July protocol adds cache hints for applicable list and resource responses. A client can reuse an eligible response within its stated lifetime and scope. Distinguish reusable catalog metadata from cached business results. A catalog entry for a purchasing tool cannot authorize a purchase; even a fresh list can describe an operation the current caller cannot perform on a particular item.
Cache a tool catalog for two shop employees
Inside this chapter
Chapter sources- Addressable resources
- A URI locates content whose current accessibility and revision depend on the server. Keep identifiers and provenance alongside returned data. Use the response’s cache hints only where their lifetime and scope permit reuse.
A resource is data the server makes available at a URI, such as a file, a manual page or a database view. The host decides whether and how it enters the model's context. Keep the URI and revision beside the content so answers can cite their source and you can tell when a copy is stale. When responses carry cache hints, the lifetime says how long a copy stays valid and the scope says who it may be reused for.
Example. A price manual remains cached for buyer A. Before showing it to buyer B, check whether the scope covers B and B can read the resource.
Can buyer B see the cached manual?
A cache hit answers 'do I have a copy', never 'may this person see it'. - Reusable prompt templates
- A server can publish a named prompt and accept arguments. Fetching the template yields messages for the host to consider. The host retains control over what is included in context and which later actions are permitted.
A server-published prompt is a named, parameterised set of messages, often surfaced to users as a menu item or slash command. Retrieving it returns text for the host to use; it has no side effects. Even if the text instructs the model to reserve stock, nothing happens unless the model later proposes a tool call and the host and server both allow it.
Example. A review prompt mentions checking stock. Fetching that prompt neither checks stock nor reserves an item.
Fetching a prompt is just fetching text
Any later stock check would be a separate tool call, approved and validated on its own. - Tool contracts and effects
- A tool names a capability and describes inputs. Validate the requested action and its domain invariants at the server. Stable catalog order and cache hints help clients reuse discovery metadata without reordering model context unnecessarily.
A tool definition gives a name, a description the model reads, and a JSON Schema for arguments. Schema validation catches malformed calls, but permissions, stock levels and limits are domain rules the server checks during execution. Keep the catalogue order stable between listings: reordering tools changes the model's context, which can shift behaviour and defeat prompt caching for no reason.
Example. Two buyers see reserve_stock in discovery, but the server permits only one to reserve warehouse A inventory.
Another example. Two buyers both see reserve_stock. Buyer 1 holds 5 units in warehouse A; buyer 2's identical call is refused because their account is limited to warehouse B.
JSON{ "name": "reserve_stock", "description": "Hold units of a product in one warehouse for the calling buyer.", "inputSchema": { "type": "object", "properties": { "sku": {"type": "string"}, "warehouse": {"type": "string"}, "quantity": {"type": "integer", "minimum": 1} }, "required": ["sku", "warehouse", "quantity"] }}The definition describes valid input. Whether this buyer may reserve in warehouse A is decided by the server at call time. - Who controls each primitive
- The specification frames the three primitives by who drives their use. Tools are model-controlled: the model proposes calls and the host approves. Resources are application-controlled: the host decides which data to attach. Prompts are user-controlled: a person typically picks them explicitly.
Thinking about who is in control helps place safeguards. Model-driven actions need the strongest gate, because the model may be steered by content it read. Application-driven data needs scoping so the wrong document is not attached. User-driven prompts need little gating, but whatever they lead to still goes through the tool path.
Example. In a shop assistant, the user picks the review prompt, the host attaches the price manual resource, and the model proposes reserve_stock as a tool call.
Three primitives, three drivers
Tools: model proposes
Operations with effects, such as
reserve_stock. The host approves, the server validates.Resources: application attaches
Addressable data, such as the price manual. The host chooses what enters context.
Prompts: user selects
Named templates, such as
review_order. Retrieval only returns messages.
November 2025 protocol notes
Read a manual, request a template or reserve stock?
Resources expose addressable context, prompts expose reusable interaction templates and tools expose callable operations. These primitives differ in discovery, intended control and the meaning of a result. A server can implement a subset.
Choose the primitive according to what the user is trying to obtain or change. Preserve provenance for returned content and enforce scoped authority before any server-side effect, regardless of how the capability was discovered.
- Resources & URI Schemes
- A resource is addressable data identified by a URI. A catalog server might expose a versioned product manual that the client can read. Treat the URI as an identifier, not proof of permission. Servers must enforce access and clients should preserve the source identity when incorporating content. Read a versioned manual URI as two users with different entitlements. A known URI must not let the second reader bypass authorization.
- Prompts & Templating
- A prompt is a reusable, server-provided message template that clients can discover and request with arguments. It can package a review workflow for a selected document. Keep prompt discovery distinct from tool execution. Retrieving a template alone does not authorize effects suggested by its text. Fetch a review template that asks for a document ID. Verify that fetching it produces messages but performs no document write.
- Tool Definition Strategy
- Define tools around narrow, meaningful actions with descriptive names and explicit schemas. Separate a quote from a purchase. Report validation failures and domain errors clearly so the host can decide whether another attempt makes sense. The server must enforce authorization independently of tool descriptions. Separate get_quote from place_order. A caller permitted to retrieve a quote must still be unable to place an order without independent authorization.
How it works
Step through the idea, or press Play.
Catalog key. Identify the caller and scope
Understand it
Worked example
Cache a tool catalog for two shop employees
- 1
Identify the caller and scope
A buyer opens the shop catalog. The client checks for a compatible entry under the response’s allowed cache scope and expiry.
- 2
List available operations
A miss retrieves the caller’s tool metadata. The client preserves list order and honors the supplied caching information.
- 3
Validate a reservation separately
Calling reserve_stock requires current authorization and available stock. A catalog hit supplies neither.
Follow the handoffs
Serving the catalogue to employee 2
Four requests, four answers
| Request | Cache result | Reason |
|---|---|---|
| Employee 1 opens catalogue | miss, fetch | nothing cached yet |
| Employee 1 again, soon after | hit | same scope, within lifetime |
| Employee 2 opens catalogue | miss, fetch | entry scoped to employee 1 |
| Employee 2 calls reserve_stock | not a cache question | server checks authority and stock |
Summary
The whole topic in one minute.
Cache scope describes reuse eligibility. Business authorization also applies independently when a tool is called.
The July protocol adds cache hints for applicable list and resource responses. A client can reuse an eligible response within its stated lifetime and scope. Distinguish reusable catalog metadata from cached business results. A catalog entry for a purchasing tool cannot authorize a purchase; even a fresh list can describe an operation the current caller cannot perform on a particular item.