Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/server/streamableHttp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ export class StreamableHTTPServerTransport implements Transport {
let requestId = options?.relatedRequestId;
if (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) {
// If the message is a response, use the request ID from the message
requestId = message.id;
requestId = message.id ?? undefined;
}

// Check if this message should be sent on the standalone SSE stream (no request ID)
Expand Down
2 changes: 1 addition & 1 deletion src/spec.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export interface JSONRPCResultResponse {
*/
export interface JSONRPCErrorResponse {
jsonrpc: typeof JSONRPC_VERSION;
id?: RequestId;
id: RequestId | null;
error: Error;
}

Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export enum ErrorCode {
export const JSONRPCErrorResponseSchema = z
.object({
jsonrpc: z.literal(JSONRPC_VERSION),
id: RequestIdSchema.optional(),
id: RequestIdSchema.nullable(),
error: z.object({
/**
* The error type that occurred.
Expand Down
Loading