Skip to content

Commit e968b76

Browse files
mowens3claude
andcommitted
Fix JsonRpc\Error id parameter (expects int|string, not null)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 49a51f0 commit e968b76

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/ErrorBag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ public function toJsonRpcError(): object
287287
unset($data['success'], $data['error']);
288288

289289
return new \Mcp\Schema\JsonRpc\Error(
290-
null, // JSON-RPC request ID (null for notifications/errors)
290+
0, // JSON-RPC request ID (0 as placeholder when ID unknown)
291291
$primary->getJsonRpcCode(),
292292
$this->getSummaryMessage(),
293293
$data

src/McpError.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ public function toJsonRpcError(): object
384384
unset($data['success'], $data['error']);
385385

386386
return new \Mcp\Schema\JsonRpc\Error(
387-
null, // JSON-RPC request ID (null for notifications/errors)
387+
0, // JSON-RPC request ID (0 as placeholder when ID unknown)
388388
$this->getJsonRpcCode(),
389389
$this->getMessage(),
390390
empty($data) ? null : $data

0 commit comments

Comments
 (0)