# Fix: unknown JSON-RPC method returns -32601

> Web-audit fix skill for the `mcp-unknown-method` check (MCP & API, SHOULD).

## Goal

Reject unknown JSON-RPC methods with error -32601 instead of a hang or 500.

## Fix

Reject an unknown JSON-RPC method with the standard error code `-32601` (Method not found),
not a hang, a 500, or a silent empty body. Agents rely on `-32601` to distinguish
"unsupported" from "failed"; anything else looks like an outage.

## Resources

- [JSON-RPC 2.0](https://www.jsonrpc.org/specification#error_object)

## Copy-paste prompt

Paste this into your coding agent, replacing the Issue line with the Result line from [your audit](https://anc.dev/web-audit):

```text
Goal: Reject unknown JSON-RPC methods with error -32601 instead of a hang or 500
Issue: <the audit's finding for this check>
Fix: Reject an unknown JSON-RPC method with the standard error code `-32601` (Method not found), not a hang, a 500, or a silent empty body. Agents rely on `-32601` to distinguish "unsupported" from "failed"; anything else looks like an outage.
Skill: https://anc.dev/web-audit/skill/mcp-unknown-method
Docs: https://www.jsonrpc.org/specification#error_object
```

## Verify

Re-run the audit at [https://anc.dev/web-audit](https://anc.dev/web-audit) or call the `audit_website` MCP tool; the `mcp-unknown-method` check should report `pass`.
