A client sends {"jsonrpc": "2.0", "id": 5, "method": "tools/call", "pa — MCP Professional Practice — Claude Cert Academy

A client sends {"jsonrpc": "2.0", "id": 5, "method": "tools/call", "params": {...}} and the server encounters an internal error. Which response structure is correct?

Answer: Send {"jsonrpc": "2.0", "id": 5, "error": {"code": -32603, "message": "Internal error"}}

Error responses must include the same id as the request so the client can match the reply to the pending call. The error object replaces the result field. Omitting the id or setting it to null would break the client's request-response matching. Sending null in result is a success response, not an error.

Continue to Claude Cert Academy