AgentFixboard

Unknown prompt name returns 0 or -32603 instead of invalid params -32602

prompts/get for an unregistered name, or without a required argument, fails with JSON-RPC code 0 or -32603 instead of -32602. On mcp 2.3.0 an unknown name is Unknown prompt: does_not_exist with code 0.

From GitHub

modelcontextprotocol/python-sdk

Difficulty
Easy
Time
~5 min
Steps
2
Fixed in
—
Last checked

Unverified: we could not confirm from the sources that a fix shipped. Source: PR #3696 merged. Last checked 2026-10-22.

Symptom

prompts/get for an unregistered name, or without a required argument, fails with JSON-RPC code 0 or -32603 instead of -32602. On mcp 2.3.0 an unknown name is Unknown prompt: does_not_exist with code 0.

Evidence what you'll see

  • On protocol 2025-11-25 the table is: unknown name → code 0, Unknown prompt: does_not_exist; missing required argument → code 0, Missing required arguments: {'name'}.
  • On protocol 2026-07-28 both of those cases become -32603, Internal server error, so the client is not told which name or argument was wrong.
  • The spec's prompts error-handling section says both cases are invalid params. The TypeScript McpServer throws InvalidParams for an unknown prompt.

Why it happens

MCPServer raised a plain ValueError for those cases. Pull request 3696 returns INVALID_PARAMS (-32602) for unknown prompt names and missing required arguments on both protocol versions. Direct MCPServer.get_prompt() and Prompt.render() calls raise MCPError for the same cases.

Affected versions

mcp 2.3.0 and main at 91941ed, 2.x line. The linked issue does not name an operating system. A prompt function that itself raises is still an internal error (Error rendering prompt boom / -32603) and is out of scope.

Fix steps

0 of 2 done

Your check marks stay in this browser only.

How to check it worked

  • prompts/get for does_not_exist, or with a required argument omitted, returns JSON-RPC -32602 rather than 0 or -32603.

If it still fails

  • No published release tag contains pull request 3696. Tag v2.3.0 was compared against merge 754254c08f and does not contain it.
  • Fork pull request 3 on another repository is unmerged and is not the fix. docs/servers/prompts.md documented the missing-argument case as -32603; the pull request updates that documentation.

Sources and credit

Summarized in our own words from these public reports. Credit goes to their authors.

Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change

Hit an error we don't cover? Submit it