diff --git a/docs/specification/2026-07-28/schema.mdx b/docs/specification/2026-07-28/schema.mdx index 80a91140c..706453adc 100644 --- a/docs/specification/2026-07-28/schema.mdx +++ b/docs/specification/2026-07-28/schema.mdx @@ -1367,18 +1367,27 @@ requested.

+
+ +### `SubscriptionsListenResultResponse` + +
interface SubscriptionsListenResultResponse {
  jsonrpc: "2.0";
  id: RequestId;
  result: SubscriptionsListenResult;
}

A successful response from the server for a subscriptions/listen +request, sent when the server tears the subscription down gracefully.

Example: Subscription closed gracefully response
{
"jsonrpc": "2.0",
"id": "listen-1",
"result": {
"resultType": "complete",
"_meta": {
"io.modelcontextprotocol/subscriptionId": "listen-1"
}
}
}
+
+ +
### `SubscriptionsListenResult` -
interface SubscriptionsListenResult {
  resultType: string;
  _meta: SubscriptionsListenResultMeta;
  [key: string]: unknown;
}

The response to a subscriptions/listen +

interface SubscriptionsListenResult {
  resultType: string;
  _meta: SubscriptionsListenResultMetaObject;
  [key: string]: unknown;
}

The response to a subscriptions/listen request, signalling that the subscription has ended gracefully (for example, during server shutdown). Because the listen stream is long-lived, this result is sent only when the server tears the subscription down; an abrupt transport close carries no response. The result body is otherwise empty.

Example: Subscription closed gracefully
{
"resultType": "complete",
"_meta": {
"io.modelcontextprotocol/subscriptionId": "listen-1"
}
}

Indicates the type of the result, which allows the client to determine how to parse the result object.

Servers implementing this protocol version MUST include this field. For backward compatibility, when a client receives a result from a -server implementing an earlier protocol version (which does not include resultType), the client MUST treat the absent field as "complete".

+server implementing an earlier protocol version (which does not include resultType), the client MUST treat the absent field as "complete".

@@ -1394,15 +1403,15 @@ Replaces the former resources/subscribe RPC.

-### `SubscriptionsListenResultMeta` +### `SubscriptionsListenResultMetaObject` -
interface SubscriptionsListenResultMeta {
  "io.modelcontextprotocol/serverInfo"?: Implementation;
  "io.modelcontextprotocol/subscriptionId": RequestId;
  [key: string]: unknown;
}

Extends ResultMetaObject with the subscription-stream identifier carried by a SubscriptionsListenResult. All key naming rules from MetaObject apply.

MetaObject for key naming rules and reserved prefixes.

Identifies the server software producing the response. Servers SHOULD +

interface SubscriptionsListenResultMetaObject {
  "io.modelcontextprotocol/serverInfo"?: Implementation;
  "io.modelcontextprotocol/subscriptionId": RequestId;
  [key: string]: unknown;
}

Extends ResultMetaObject with the subscription-stream identifier carried by a SubscriptionsListenResult. All key naming rules from MetaObject apply.

MetaObject for key naming rules and reserved prefixes.

Identifies the server software producing the response. Servers SHOULD include this field on every response unless specifically configured not to do so.

The Implementation schema requires name and version; other fields are optional.

The value is self-reported by the server and is not verified by the protocol. It is intended for display, logging, and debugging. Clients SHOULD NOT use it to change their behavior, and SHOULD NOT rely on it for -security decisions.

Identifies the subscription stream this response closes, so the client can +security decisions.

Identifies the subscription stream this response closes, so the client can correlate it with the originating subscription — mirroring the same key on the stream's notifications. The value is the JSON-RPC ID of the subscriptions/listen request that opened the stream (and equals this response's id).

diff --git a/docs/specification/draft/schema.mdx b/docs/specification/draft/schema.mdx index 0eeea3176..159c7be5e 100644 --- a/docs/specification/draft/schema.mdx +++ b/docs/specification/draft/schema.mdx @@ -1367,18 +1367,27 @@ requested.

+
+ +### `SubscriptionsListenResultResponse` + +
interface SubscriptionsListenResultResponse {
  jsonrpc: "2.0";
  id: RequestId;
  result: SubscriptionsListenResult;
}

A successful response from the server for a subscriptions/listen +request, sent when the server tears the subscription down gracefully.

Example: Subscription closed gracefully response
{
"jsonrpc": "2.0",
"id": "listen-1",
"result": {
"resultType": "complete",
"_meta": {
"io.modelcontextprotocol/subscriptionId": "listen-1"
}
}
}
+
+ +
### `SubscriptionsListenResult` -
interface SubscriptionsListenResult {
  resultType: string;
  _meta: SubscriptionsListenResultMeta;
  [key: string]: unknown;
}

The response to a subscriptions/listen +

interface SubscriptionsListenResult {
  resultType: string;
  _meta: SubscriptionsListenResultMetaObject;
  [key: string]: unknown;
}

The response to a subscriptions/listen request, signalling that the subscription has ended gracefully (for example, during server shutdown). Because the listen stream is long-lived, this result is sent only when the server tears the subscription down; an abrupt transport close carries no response. The result body is otherwise empty.

Example: Subscription closed gracefully
{
"resultType": "complete",
"_meta": {
"io.modelcontextprotocol/subscriptionId": "listen-1"
}
}

Indicates the type of the result, which allows the client to determine how to parse the result object.

Servers implementing this protocol version MUST include this field. For backward compatibility, when a client receives a result from a -server implementing an earlier protocol version (which does not include resultType), the client MUST treat the absent field as "complete".

+server implementing an earlier protocol version (which does not include resultType), the client MUST treat the absent field as "complete".

@@ -1394,15 +1403,15 @@ Replaces the former resources/subscribe RPC.

-### `SubscriptionsListenResultMeta` +### `SubscriptionsListenResultMetaObject` -
interface SubscriptionsListenResultMeta {
  "io.modelcontextprotocol/serverInfo"?: Implementation;
  "io.modelcontextprotocol/subscriptionId": RequestId;
  [key: string]: unknown;
}

Extends ResultMetaObject with the subscription-stream identifier carried by a SubscriptionsListenResult. All key naming rules from MetaObject apply.

MetaObject for key naming rules and reserved prefixes.

Identifies the server software producing the response. Servers SHOULD +

interface SubscriptionsListenResultMetaObject {
  "io.modelcontextprotocol/serverInfo"?: Implementation;
  "io.modelcontextprotocol/subscriptionId": RequestId;
  [key: string]: unknown;
}

Extends ResultMetaObject with the subscription-stream identifier carried by a SubscriptionsListenResult. All key naming rules from MetaObject apply.

MetaObject for key naming rules and reserved prefixes.

Identifies the server software producing the response. Servers SHOULD include this field on every response unless specifically configured not to do so.

The Implementation schema requires name and version; other fields are optional.

The value is self-reported by the server and is not verified by the protocol. It is intended for display, logging, and debugging. Clients SHOULD NOT use it to change their behavior, and SHOULD NOT rely on it for -security decisions.

Identifies the subscription stream this response closes, so the client can +security decisions.

Identifies the subscription stream this response closes, so the client can correlate it with the originating subscription — mirroring the same key on the stream's notifications. The value is the JSON-RPC ID of the subscriptions/listen request that opened the stream (and equals this response's id).

diff --git a/schema/2026-07-28/examples/SubscriptionsListenResultResponse/listen-closed-response.json b/schema/2026-07-28/examples/SubscriptionsListenResultResponse/listen-closed-response.json new file mode 100644 index 000000000..9441979a4 --- /dev/null +++ b/schema/2026-07-28/examples/SubscriptionsListenResultResponse/listen-closed-response.json @@ -0,0 +1,10 @@ +{ + "jsonrpc": "2.0", + "id": "listen-1", + "result": { + "resultType": "complete", + "_meta": { + "io.modelcontextprotocol/subscriptionId": "listen-1" + } + } +} diff --git a/schema/2026-07-28/schema.json b/schema/2026-07-28/schema.json index cc44564e3..213c58f6d 100644 --- a/schema/2026-07-28/schema.json +++ b/schema/2026-07-28/schema.json @@ -3400,7 +3400,7 @@ "description": "The response to a {@link SubscriptionsListenRequestsubscriptions/listen}\nrequest, signalling that the subscription has ended gracefully (for example,\nduring server shutdown). Because the listen stream is long-lived, this result\nis sent only when the server tears the subscription down; an abrupt transport\nclose carries no response. The result body is otherwise empty.", "properties": { "_meta": { - "$ref": "#/$defs/SubscriptionsListenResultMeta" + "$ref": "#/$defs/SubscriptionsListenResultMetaObject" }, "resultType": { "description": "Indicates the type of the result, which allows the client to determine\nhow to parse the result object.\n\nServers implementing this protocol version MUST include this field.\nFor backward compatibility, when a client receives a result from a\nserver implementing an earlier protocol version (which does not include\n`resultType`), the client MUST treat the absent field as `\"complete\"`.", @@ -3413,7 +3413,7 @@ ], "type": "object" }, - "SubscriptionsListenResultMeta": { + "SubscriptionsListenResultMetaObject": { "description": "Extends {@link ResultMetaObject} with the subscription-stream identifier carried by a\n{@link SubscriptionsListenResult}. All key naming rules from `MetaObject` apply.", "properties": { "io.modelcontextprotocol/serverInfo": { @@ -3430,6 +3430,27 @@ ], "type": "object" }, + "SubscriptionsListenResultResponse": { + "description": "A successful response from the server for a {@link SubscriptionsListenRequestsubscriptions/listen}\nrequest, sent when the server tears the subscription down gracefully.", + "properties": { + "id": { + "$ref": "#/$defs/RequestId" + }, + "jsonrpc": { + "const": "2.0", + "type": "string" + }, + "result": { + "$ref": "#/$defs/SubscriptionsListenResult" + } + }, + "required": [ + "id", + "jsonrpc", + "result" + ], + "type": "object" + }, "TextContent": { "description": "Text provided to or from an LLM.", "properties": { diff --git a/schema/2026-07-28/schema.ts b/schema/2026-07-28/schema.ts index 241b7e3f3..9b55feeb4 100644 --- a/schema/2026-07-28/schema.ts +++ b/schema/2026-07-28/schema.ts @@ -1323,7 +1323,7 @@ export interface SubscriptionsListenRequest extends JSONRPCRequest { * @see {@link MetaObject} for key naming rules and reserved prefixes. * @category `subscriptions/listen` */ -export interface SubscriptionsListenResultMeta extends ResultMetaObject { +export interface SubscriptionsListenResultMetaObject extends ResultMetaObject { /** * Identifies the subscription stream this response closes, so the client can * correlate it with the originating subscription — mirroring the same key on @@ -1347,7 +1347,20 @@ export interface SubscriptionsListenResultMeta extends ResultMetaObject { * @category `subscriptions/listen` */ export interface SubscriptionsListenResult extends Result { - _meta: SubscriptionsListenResultMeta; + _meta: SubscriptionsListenResultMetaObject; +} + +/** + * A successful response from the server for a {@link SubscriptionsListenRequest | subscriptions/listen} + * request, sent when the server tears the subscription down gracefully. + * + * @example Subscription closed gracefully response + * {@includeCode ./examples/SubscriptionsListenResultResponse/listen-closed-response.json} + * + * @category `subscriptions/listen` + */ +export interface SubscriptionsListenResultResponse extends JSONRPCResultResponse { + result: SubscriptionsListenResult; } /** diff --git a/schema/draft/examples/SubscriptionsListenResultResponse/listen-closed-response.json b/schema/draft/examples/SubscriptionsListenResultResponse/listen-closed-response.json new file mode 100644 index 000000000..9441979a4 --- /dev/null +++ b/schema/draft/examples/SubscriptionsListenResultResponse/listen-closed-response.json @@ -0,0 +1,10 @@ +{ + "jsonrpc": "2.0", + "id": "listen-1", + "result": { + "resultType": "complete", + "_meta": { + "io.modelcontextprotocol/subscriptionId": "listen-1" + } + } +} diff --git a/schema/draft/schema.json b/schema/draft/schema.json index cc44564e3..213c58f6d 100644 --- a/schema/draft/schema.json +++ b/schema/draft/schema.json @@ -3400,7 +3400,7 @@ "description": "The response to a {@link SubscriptionsListenRequestsubscriptions/listen}\nrequest, signalling that the subscription has ended gracefully (for example,\nduring server shutdown). Because the listen stream is long-lived, this result\nis sent only when the server tears the subscription down; an abrupt transport\nclose carries no response. The result body is otherwise empty.", "properties": { "_meta": { - "$ref": "#/$defs/SubscriptionsListenResultMeta" + "$ref": "#/$defs/SubscriptionsListenResultMetaObject" }, "resultType": { "description": "Indicates the type of the result, which allows the client to determine\nhow to parse the result object.\n\nServers implementing this protocol version MUST include this field.\nFor backward compatibility, when a client receives a result from a\nserver implementing an earlier protocol version (which does not include\n`resultType`), the client MUST treat the absent field as `\"complete\"`.", @@ -3413,7 +3413,7 @@ ], "type": "object" }, - "SubscriptionsListenResultMeta": { + "SubscriptionsListenResultMetaObject": { "description": "Extends {@link ResultMetaObject} with the subscription-stream identifier carried by a\n{@link SubscriptionsListenResult}. All key naming rules from `MetaObject` apply.", "properties": { "io.modelcontextprotocol/serverInfo": { @@ -3430,6 +3430,27 @@ ], "type": "object" }, + "SubscriptionsListenResultResponse": { + "description": "A successful response from the server for a {@link SubscriptionsListenRequestsubscriptions/listen}\nrequest, sent when the server tears the subscription down gracefully.", + "properties": { + "id": { + "$ref": "#/$defs/RequestId" + }, + "jsonrpc": { + "const": "2.0", + "type": "string" + }, + "result": { + "$ref": "#/$defs/SubscriptionsListenResult" + } + }, + "required": [ + "id", + "jsonrpc", + "result" + ], + "type": "object" + }, "TextContent": { "description": "Text provided to or from an LLM.", "properties": { diff --git a/schema/draft/schema.ts b/schema/draft/schema.ts index 110485f68..b2119e148 100644 --- a/schema/draft/schema.ts +++ b/schema/draft/schema.ts @@ -1323,7 +1323,7 @@ export interface SubscriptionsListenRequest extends JSONRPCRequest { * @see {@link MetaObject} for key naming rules and reserved prefixes. * @category `subscriptions/listen` */ -export interface SubscriptionsListenResultMeta extends ResultMetaObject { +export interface SubscriptionsListenResultMetaObject extends ResultMetaObject { /** * Identifies the subscription stream this response closes, so the client can * correlate it with the originating subscription — mirroring the same key on @@ -1347,7 +1347,20 @@ export interface SubscriptionsListenResultMeta extends ResultMetaObject { * @category `subscriptions/listen` */ export interface SubscriptionsListenResult extends Result { - _meta: SubscriptionsListenResultMeta; + _meta: SubscriptionsListenResultMetaObject; +} + +/** + * A successful response from the server for a {@link SubscriptionsListenRequest | subscriptions/listen} + * request, sent when the server tears the subscription down gracefully. + * + * @example Subscription closed gracefully response + * {@includeCode ./examples/SubscriptionsListenResultResponse/listen-closed-response.json} + * + * @category `subscriptions/listen` + */ +export interface SubscriptionsListenResultResponse extends JSONRPCResultResponse { + result: SubscriptionsListenResult; } /** diff --git a/scripts/generate-schemas.ts b/scripts/generate-schemas.ts index 294dad44e..6b27cd3cd 100644 --- a/scripts/generate-schemas.ts +++ b/scripts/generate-schemas.ts @@ -11,7 +11,7 @@ const execAsync = promisify(exec); const LEGACY_SCHEMAS = ['2024-11-05', '2025-03-26', '2025-06-18']; // Modern schema versions that use JSON Schema 2020-12 -const MODERN_SCHEMAS = ['2025-11-25', 'draft']; +const MODERN_SCHEMAS = ['2025-11-25', '2026-07-28', 'draft']; // All schema versions to generate const ALL_SCHEMAS = [...LEGACY_SCHEMAS, ...MODERN_SCHEMAS];