Skip to content

fix(sep-2164): grade the resource-not-found error code as a MUST - #554

Open
cig13zs wants to merge 1 commit into
modelcontextprotocol:mainfrom
cig13zs:fix/sep-2164-error-code-must
Open

cig13zs wants to merge 1 commit into
modelcontextprotocol:mainfrom
cig13zs:fix/sep-2164-error-code-must

Conversation

@cig13zs

@cig13zs cig13zs commented Oct 15, 2026

Copy link
Copy Markdown

Closes #552.

sep-2164-error-code reports WARNING when a server answers a non-existent resource with something other than -32602. That matched the spec text when #246 landed, but modelcontextprotocol/modelcontextprotocol#2863 aligned the spec with SEP-2164 and the released 2026-07-28 page now reads:

If the requested resource does not exist, servers MUST return a JSON-RPC error with code -32602 (Invalid Params).

basic/index also lists -32002 among the codes 2026-07-28 implementations MUST NOT emit. Since the server runner doesn't count warnings, a server that still sends -32002 currently passes the scenario outright:

main:   [sep-2164-error-code] WARNING ... Passed: 3/3, 0 failed, 1 warnings
branch: [sep-2164-error-code] FAILURE ... Passed: 3/4, 1 failed, 0 warnings

The check now reports FAILURE, the -32002 hint says the code is retired, and sep-2164.yaml quotes the current sentence. sep-2164-data-uri stays a SHOULD; that one comes from the SEP text, not the spec page.

Tests: the existing empty-contents negative case now expects FAILURE, and a new inline server answering -32002 asserts error-code FAILURE with the other two checks green. Both fail on main. npm run check, npm run build and npm test (642) pass; the everything-server still passes 4/4 since it already returns -32602. The scenario is draft-only, so only 2026-07-28 runs are affected. SDKs that still emit -32002 on that wire (the SEP lists C#, Rust, Java, Go and PHP as having done so) will now fail it.

src/seps/traceability.json still carries the old row text; I left it for the traceability workflow, per AGENTS.md.

AI disclosure per AI_POLICY.md: the investigation, code and tests were done primarily with Claude Code. The numbers above are from local runs.

The released 2026-07-28 resources page says servers MUST return -32602
for a resource that does not exist (the spec text was aligned with the
SEP in modelcontextprotocol/modelcontextprotocol#2863), and basic/index
lists -32002 among the codes 2026-07-28 implementations MUST NOT emit.
sep-2164-error-code still graded the older SHOULD wording, so a server
answering -32002 or -32603 only drew a WARNING. Report FAILURE instead
and quote the current text in sep-2164.yaml.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sep-2164-error-code grades the resource-not-found code as SHOULD; 2026-07-28 makes it MUST

1 participant