Skip to content

Commit a841b3c

Browse files
BabyChrist666claude
andcommitted
Fix pyright: remove unnecessary isinstance check
With dict[str, Any] type annotation, isinstance(data, dict) is redundant. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 2a0d65d commit a841b3c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/mcp/types/jsonrpc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def _reject_id_field(cls, data: dict[str, Any]) -> dict[str, Any]:
4242
raw payload contains ``"id"`` (regardless of its value), it is a
4343
malformed request — not a valid notification.
4444
"""
45-
if isinstance(data, dict) and "id" in data:
45+
if "id" in data:
4646
raise ValueError(
4747
"Notifications must not include an 'id' field. "
4848
"A JSON-RPC message with 'id' is a request, not a notification."

0 commit comments

Comments
 (0)