Skip to content

Fix draft spec examples and restore dropped guidance#2890

Open
pja-ant wants to merge 5 commits into
mainfrom
fix/draft-doc-examples
Open

Fix draft spec examples and restore dropped guidance#2890
pja-ant wants to merge 5 commits into
mainfrom
fix/draft-doc-examples

Conversation

@pja-ant

@pja-ant pja-ant commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

What this does

Documentation-only fixes to docs/specification/draft/: brings examples in line with the draft schema, restores guidance lost in the restructure, and documents two wire-format changes in the changelog.

Why now

Most request/response examples in the draft currently fail validation against the draft schema, so anyone implementing from the docs produces non-conformant messages.

Changes

  • Add a note to each server feature page stating that request examples omit the required _meta request metadata for brevity, linking to the base-protocol definition.
  • Add the missing required resultType to six response examples (tools, completion, pagination), remove a stray resultType from a request example in completion.mdx, and add the missing ttlMs/cacheScope to the pagination list example.
  • Add ttlMs/cacheScope/resultType rows to discover.mdx's Response Fields table (they are required on DiscoverResult but absent from the table).
  • Fix the client capability examples in elicitation/sampling/roots, which still nested capabilities under the obsolete {"capabilities": ...} wrapper from the removed initialize request — copied verbatim, servers read that as declaring no capability.
  • Relabel the client feature pages' "Request/Response" example pairs to the MRTR envelope framing (inputRequests / inputResponses), since the server-initiated RPC shape they implied no longer exists.
  • Fix a dangling reference to the removed URLElicitationRequiredError (-32042) in elicitation.mdx; the retry flow now references InputRequiredResult/requestState.
  • Remove a pattern property from the StringSchema example that the schema does not define.
  • Restore the request-timeout guidance that was dropped when basic/lifecycle.mdx was deleted, updated for the new model (closing the response stream on Streamable HTTP, notifications/cancelled on stdio); lives in basic/patterns/cancellation.mdx.
  • Scope caching.mdx's blanket MUST to results with resultType: "complete" (an InputRequiredResult has no caching fields) and add a Cache Key section (results from MRTR retries are not cacheable).
  • Changelog: add entries for the required resultType field on all results and for the removal of SSE stream resumability/redelivery.

Verification

npm run prep passes clean, including the link checker.

pja-ant added 5 commits June 7, 2026 13:56
- Show client capability declarations in their real shape: the value of
  _meta["io.modelcontextprotocol/clientCapabilities"] is the
  ClientCapabilities object, not a top-level "capabilities" wrapper
  (which belonged to the removed initialize request).
- Relabel embedded Request/Response example pairs on elicitation,
  sampling, and roots pages to make the MRTR envelope clear: input
  requests are delivered inside InputRequiredResult.inputRequests, and
  client results are returned inside inputResponses on the retried
  request. Strip the leftover JSON-RPC result wrappers from those
  examples.
- Replace the dangling URLElicitationRequiredError reference (the error
  no longer exists) with the InputRequiredResult/requestState retry flow.
- Remove the unsupported pattern property from the StringSchema example
  in the restricted elicitation schema subset.
…fields

- Add a note to tools, resources, prompts, completion, and pagination
  pages stating that request examples omit the required _meta request
  metadata for brevity, with a link to the _meta documentation.
- Add the missing resultType: "complete" field to result examples on
  the tools, completion, and pagination pages.
- Remove a stray top-level resultType field from a completion/complete
  request example (the field belongs on results, not requests).
- Add ttlMs and cacheScope to the pagination resources/list response
  example, matching the caching requirements for list results.
- Add resultType, ttlMs, and cacheScope rows to the server/discover
  Response Fields table.
…ellation

The Timeouts section from the 2025-11-25 lifecycle page was dropped in
the draft restructure. Re-add it to the cancellation page: senders
SHOULD establish per-request timeouts, cancel on expiry (closing the
response stream on Streamable HTTP, sending notifications/cancelled on
stdio), MAY reset the clock on progress notifications, and SHOULD
enforce a maximum timeout regardless.
- Scope the caching-hints MUST to results with resultType "complete":
  interim input_required results from multi round-trip requests are not
  CacheableResults and carry no caching hints.
- Define what identifies a cached response (method plus the request
  parameters that affect the result) and forbid caching results produced
  via MRTR retries carrying inputResponses or requestState.
…moval

- New major-changes entry: all results carry a required resultType
  field ("complete" or "input_required"); clients treat an absent
  field from earlier-protocol servers as "complete".
- Reword the MRTR entry so resultType is not described as something
  only InputRequiredResult carries.
- New major-changes entry: SSE stream resumability and redelivery
  (Last-Event-ID) are removed; a broken response stream loses the
  request and clients re-issue it as a new request.
@mintlify

mintlify Bot commented Jun 7, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
mcp-staging 🟢 Ready View Preview Jun 7, 2026, 1:05 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@mintlify

mintlify Bot commented Jun 7, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
mcp 🟢 Ready View Preview Jun 7, 2026, 1:05 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@pja-ant pja-ant marked this pull request as ready for review June 7, 2026 13:12
@pja-ant pja-ant requested a review from a team as a code owner June 7, 2026 13:12
@localden localden added spec rc-high-priority Related to an upcoming specification release and needs to be addressed with a high priority. labels Jun 8, 2026
- **stdio**: There is no per-request stream to close. The client **MUST** send a
`notifications/cancelled` notification referencing the request ID.

## Timeouts

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for adding this guidance

`cursor` for paginated list requests). Clients **MUST NOT** serve a cached response for
a request whose method or parameters differ from the request that produced it.

Results produced by retrying a request through the

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine to clarify, but we don't technically support MRTR on any of the Cacheable Results. So in practice not an issue in the current spec.

| `capabilities` | `ServerCapabilities` | yes | Capabilities the server supports (tools, resources, prompts, etc.). |
| `serverInfo` | `Implementation` | yes | Name and version of the server software. |
| `instructions` | `string` | no | Natural-language guidance for LLMs on how to use this server effectively. |
| Field | Type | Required | Description |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section is a bit different than most of our doc pages, which is causing us to update any time any part of the message envelope changes which is not ideal.

The typical pattern most pages use is defining Data Types which are specific to the concept being introduced. Prompts, Resources, Tools all do this. I think we should re-write this section to match vs just adding all the additional fields.

@CaitieM20 CaitieM20 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should rewrite the section in discover.mdx I flagged but doesn't need to block this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rc-high-priority Related to an upcoming specification release and needs to be addressed with a high priority. spec

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants