Skip to content

docs(unstable-v2): say how a receiver handles a request with a null ID - #2875

Merged
benbrandt merged 1 commit into
mainfrom
docs/v2-null-request-id
Nov 18, 2026
Merged

benbrandt merged 1 commit into
mainfrom
docs/v2-null-request-id

Conversation

@benbrandt

Copy link
Copy Markdown
Member

Summary

The v2 overview says request IDs MUST be a string or an integer, never null. It did not say what a receiver does with a message that has a method and id: null.

Change

The overview now says, in the stable page and its draft/ copy:

A receiver rejects a message that has a method and an id of null with -32600 (Invalid request) and id: null. It does not treat the message as a notification.

This matches the rule for batches on the transports page, which also answers a forbidden message shape with -32600 and id: null.

Notes

  • The TypeScript and Rust SDKs already do this on v2 connections, and keep accepting null IDs on v1. The page now states the behavior they implement.
  • MCP forbids null request IDs in the same words and defines nothing for the receiver. This goes one step further.
  • v1 is unchanged. null request IDs remain valid there.

Checks

  • Prettier and typos pass on the changed files.
  • All links and anchors in the changed files resolve.

The overview forbids `null` request IDs but did not say what a receiver
does with a message that has a `method` and `id: null`.

Say that the receiver rejects the message with `-32600` and `id: null`,
and does not treat it as a notification. This matches the rule for
batches on the transports page, and what the TypeScript and Rust SDKs
already do on v2 connections.
@benbrandt
benbrandt requested a review from a team as a code owner November 18, 2026 13:11
@benbrandt
benbrandt enabled auto-merge (squash) November 18, 2026 13:12
@benbrandt
benbrandt merged commit f8cbc45 into main Nov 18, 2026
10 checks passed
@benbrandt
benbrandt deleted the docs/v2-null-request-id branch November 18, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant