A file server receives resources/read for file:///reports/q3.pdf, which was deleted an hour ago. It currently answers with a successful result whose contents array is empty. A reviewer flags this. Under revision 2026-07-28, what should the server return instead?
Select an answer to reveal the explanation.
Short Explanation
Find an empty box on your porch and you can't tell "nothing inside" from "no delivery at all." That's why a missing resource gets a real error, -32602, not an empty contents array. The trap is -32002, which was the old code.
Full Explanation
The resources specification addresses this case directly. If the requested resource does not exist, servers must return a JSON-RPC error with code -32602, Invalid params, and should use -32603 for internal errors. It also states that servers must not return an empty contents array for a non-existent resource, because an empty array is ambiguous: it could mean the resource exists but has no content, or that it does not exist at all. Keeping the empty array is therefore precisely the behavior the reviewer is right to flag. The isError result shape belongs to tool execution errors in tools/call responses; resources/read reports a missing resource as a protocol error, not as tool output. Code -32002 was the resource-not-found code in 2025-11-25 and earlier; implementations of this revision must not emit it, although clients should still accept it from older servers. Exam caveat: an existing but genuinely empty file can still be returned as a content entry with empty text, which is distinct from a missing resource. Operational check: delete a test file, call resources/read for its URI and confirm the response is an error object with code -32602 and a message identifying the URI, with no result field.