An MCP resource template gives a client a format for referring to many objects without adding a separate lookup tool for each object type or instance. Use templates when the client should discover and read objects through stable URIs. Keep authorization, version identity and client support explicit in the design.
Give the object an identity
Consider a fictional support portal with a runbook for each product and locale. A server might advertise a URI template such as support://runbooks/{product}/{locale}. A client can list templates using resources/templates/list and expand a concrete URI for a selected product and locale. It then reads that URI using resources/read.
Choose a scheme and path components that mean something durable to the client. A mutable friendly title makes a fragile key. For a runbook that can change, decide whether the URI identifies the latest version or an immutable revision. A latest URI is convenient for browsing. An immutable reference is useful when a later reviewer needs to recover the exact text cited in an answer.
MCP Resources specification defines URI templates, resource reads and optional subscriptions. Check the negotiated protocol revision and actual client behavior before relying on a capability. Support for reading resources does not imply that a client will automatically put a resource into a model's context.
Which desk did the original answer cite?
Suppose the Orchid runbook sends returns to desk 4 in revision r7 and desk 9 in r8. Give browsing and citation distinct addresses. In this fictional portal, support://runbooks/orchid/en/latest follows the current revision. The template support://runbooks/{product}/{locale}/revisions/{revision} names a specific edition. These address conventions belong to the portal.
When the reader selects r7, expand the template and read that exact address. Here is an illustrative result object for resources/read using the MCP revision linked above. The request already targets the versioned URI.
{
"contents": [{
"uri": "support://runbooks/orchid/en/revisions/r7",
"mimeType": "text/plain",
"text": "Route returns to desk 4."
}]
}
Now publish r8 in the fictional catalog. Our in-memory lookup gave desk 9 through latest and desk 4 through the r7 citation. A lookup of the absent r6 returned unavailable. For a current return, consult the latest revision and cite r8. For an audit of the old answer, reread r7 and cite desk 4. If r7 itself is gone, report the gap rather than silently replacing the old evidence.
The fixture checked the four lookup outcomes locally. It did not connect a client, negotiate a protocol version or measure how a model uses a resource. If two recoverable revisions appear to disagree, the guide to conflicting sources shows how to decide which one applies to the question.
Validate the expanded URI
Treat the expanded URI as input. Decode and validate parameters against known objects, check the requesting identity and confirm access to the resolved resource. Avoid mapping arbitrary URI components directly to filesystem paths or upstream URLs. A stable reference is an address under a server contract. It does not confer permission.
Define outcomes for unsupported product, inaccessible locale and removed revision. An explicit “revision unavailable” result is easier to diagnose than silently reading the latest version while preserving an old URI in the answer's citation. Keep the normal response small enough for the client's intended use and publish the content type.
Decide how changes reach clients
If the server and client support subscriptions, a change notification can prompt the client to read the resource again. It need not contain the fresh text. Arrange a reread on access or another cache invalidation policy for clients without subscriptions. If a tool points to a resource, test how the selected client handles that reference rather than assuming discovery and inlining.
The MCP server overview maps tools, resources and prompts at a higher level. A template design needs additional decisions about identity, permission and freshness.
Use a small acceptance case
Test discovery, one permitted URI, one URI with an invalid parameter and one object the user cannot read. Change a runbook and check the client's evidence selection and citation after refresh. Record separately whether the resource was discoverable, fetched and included in the model input. Those three observations give different answers when an agent misses a document.