What it does
The `resources/templates/list` method allows a client to enumerate all parameterised URI templates that the server exposes. A client sends a request object with an optional `cursor` string for pagination; the server responds with a `ResourceTemplate[]` array where each entry carries at minimum a `uriTemplate` (RFC 6570 level 1–4) and a human-readable `name`, plus optional `description` and `mimeType` fields. The client can then expand a chosen template with concrete parameter values and pass the resulting URI to `resources/read`. Before calling this method the client must inspect the server's `capabilities.resources` object returned during `initialize`. If that object is absent or if the `listChanged` flag is not set, the server may still support listing but will never push change notifications; clients should account for both cases. Calling `resources/templates/list` on a server that declared no `resources` capability results in a JSON-RPC `-32601 Method not found` error. Pagination follows the standard MCP cursor pattern: if the response includes a `nextCursor`, the client must issue another request with `cursor` set to that value to retrieve the next page. There is no guarantee that a cursor remains valid across server restarts, so clients should treat any `-32602 Invalid params` response on a cursor as a signal to restart enumeration from the beginning rather than treating it as a fatal error.
When to use
When the host wants to discover dynamic resource patterns.
When NOT to use
If your server only has fixed Resources.
Notes
Capability gating is mandatory
The server must declare `capabilities.resources` during the `initialize` handshake before a client may call this method. Sending the request without that capability being present returns a `-32601 Method not found` error. Always check `serverCapabilities.resources` before calling, and surface a clear error to the user rather than silently swallowing the JSON-RPC fault.
Cursor invalidation across restarts
MCP cursors are opaque server-issued tokens and are not guaranteed to survive a server restart or reconnect. If you receive a `-32602 Invalid params` error while paginating, discard the cursor and restart enumeration from the first page. Build your client loop to handle this transparently so that transient reconnects do not surface as hard failures.
listChanged notifications and cache invalidation
When the server capability includes `listChanged: true`, it will send a `notifications/resources/list_changed` notification whenever the template set changes. Subscribe to that notification and invalidate your cached template list on receipt. Without `listChanged` support the template list is effectively static for the session, so a single eagerly-fetched and cached list is safe.
RFC 6570 expansion is the client's responsibility
Servers return raw URI templates following RFC 6570; the client is responsible for expanding them with concrete parameter values before passing the result to `resources/read`. Most MCP SDKs do not ship a built-in RFC 6570 expander, so you will need a library such as `uri-template` (JS) or `uritemplate` (Python) to handle level 3/4 operators like `+`, `#`, and `,` correctly.
Empty array vs. missing capability
A server that supports the `resources` capability but currently has no templates returns `{templates: []}` — an empty array — which is distinct from a server that returns `-32601` because it has no capability at all. Treat the empty array as a valid state (no templates registered yet) rather than an error, especially for servers that register templates dynamically after startup.
Request parameters
| Name | Type | Purpose |
|---|---|---|
| cursor | string? | Pagination cursor. |
Response fields
| Name | Type | Purpose |
|---|---|---|
| resourceTemplates | ResourceTemplate[] | Available templates. |
| nextCursor | string? | Pagination. |
Examples
List templates
{ "method": "resources/templates/list" }