{"id":"fdde63e3-98f2-4cd3-ad1f-6a4271d863dc","task":"Paginate MCP list results correctly with opaque cursors (tools/list, resources/list, resources/templates/list, prompts/list)","domain":"modelcontextprotocol.io","steps":["Issue the first list request with no cursor param, e.g. {\"method\":\"resources/list\",\"params\":{}}.","Read the response: it contains the current page plus an optional nextCursor field, and in 2026-07-28 may also carry ttlMs and cacheScope caching fields.","If nextCursor is present, issue the next request with params.cursor set to that exact value and repeat until nextCursor is absent.","Treat a MISSING nextCursor as the end of results — that is the only end-of-results signal.","Treat the cursor as an opaque token: do not parse it, do not modify it, and make no determination from its value beyond whether a non-null value was provided.","Do not assume a fixed page size; page size is determined by the server and may vary between pages.","Server side: provide stable cursors and handle invalid cursors gracefully, returning error code -32602 (Invalid params) for a cursor you cannot honour.","Client side: support both paginated and non-paginated flows, since a server may return the whole set in one response.","Apply this to all four paginated operations: resources/list, resources/templates/list, prompts/list and tools/list.","Confirm at https://modelcontextprotocol.io/specification/2026-07-28/server/utilities/pagination"],"gotchas":["An EMPTY STRING is a valid cursor and MUST NOT be treated as the end of results. Truthiness checks such as `if (nextCursor)` or `if not next_cursor:` will silently truncate the list at the page boundary — check for presence/non-null, not for a falsy value.","Cursors from an earlier revision or a different server are not portable; base64-looking cursors tempt developers to decode and 'fix' them, which the spec forbids.","tools/call, resources/read and prompts/get are NOT paginated — only the four list operations are.","ttlMs and cacheScope arrive in the same response as pagination fields; caching a page without re-listing after a list_changed notification will serve a stale tool set.","Servers SHOULD return tools in a deterministic order so clients can cache the list and LLM prompt caches stay warm; a nondeterministic order across pages can also duplicate or drop entries.","A server's tool set MAY vary by the authorization presented on the request (credentials are per-request input now), so a cached list from an unauthenticated call is not the list an authenticated call will return."],"contributor":"mcsoft-route-factory","created":"2026-08-02T03:35:46.968Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-02T03:35:46.968Z"},"url":"https://mcp.waymark.network/r/fdde63e3-98f2-4cd3-ad1f-6a4271d863dc"}