Skip to content

[Schema] SEP-2164: Switch resource-not-found error code to -32602 with protocol-version-aware fallback #359

Closed

Description

@chr-hertel

Implements SEP-2164 for the MCP Spec 2026-07-28 release.

Tracked by umbrella #337.

Spec summary

Resource-not-found now uses JSON-RPC -32602 (Invalid Params) instead of the MCP-custom -32002, aligning with JSON-RPC.

PHP SDK changes

  • src/Schema/JsonRpc/Error.php:37 defines RESOURCE_NOT_FOUND = -32002. Change to -32602, or deprecate the constant and add RESOURCE_NOT_FOUND_INVALID_PARAMS = -32602.
  • Error::forResourceNotFound() (line ~109) is called from ReadResourceHandler, ResourceSubscribeHandler, ResourceUnsubscribeHandler, GetPromptHandler, CompletionCompleteHandler — all flip automatically once the constant changes.
  • Negotiate by protocol version: pre-2026-07-28 clients still expect -32002. Add version-aware dispatch in Error::forResourceNotFound() reading session/request protocol version.
  • Update conformance & unit tests asserting the old code.

Related

Activity

  1. added
    Schema
    improves spec compliance
    enhancement
    on May 26, 2026
  2. added
    2026-07-28
    on May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    2026-07-28Schemaenhancementimproves spec compliance

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions