Skip to Content
APIErrors

Errors

Onprest returns stable error codes with generic public messages, and keeps sensitive detail out of external responses.

REST / MCP Shared HTTP Errors

HTTPCodeMeaning
401GATEWAY_AUTH_FAILEDAPI key is missing or invalid
403GATEWAY_CAPABILITY_DENIEDAPI key cannot call the capability
403GATEWAY_IP_DENIEDSource IP is not allowed
429GATEWAY_RATE_LIMITEDRate limit exceeded
500GATEWAY_INTERNAL_ERRORUnexpected gateway error
503GATEWAY_AGENT_OFFLINEAgent is not connected
504GATEWAY_TIMEOUTAgent response timed out
502AGENT_VALIDATION_FAILEDAgent rejected params
502AGENT_QUERY_FAILEDSQL execution failed
502AGENT_QUERY_TIMEOUTQuery exceeded timeout
502AGENT_DB_UNREACHABLEAgent cannot reach the DB
502AGENT_INTERNAL_ERRORUnexpected agent error

Endpoint HTTP Errors

HTTPCodeApplies toMeaning
400GATEWAY_INVALID_REQUESTRESTJSON parse failure or invalid content type
404GATEWAY_CAPABILITY_NOT_FOUNDRESTcapability path does not exist
405GATEWAY_METHOD_NOT_ALLOWEDREST / MCPHTTP method is not allowed
409GATEWAY_AGENT_ALREADY_CONNECTEDWebSocketanother agent is already connected

MCP JSON-RPC Errors

These are returned as JSON-RPC errors with HTTP 200.

JSON-RPC codeCodeMeaning
-32700PARSE_ERRORJSON cannot be parsed
-32600INVALID_REQUESTInvalid JSON-RPC shape
-32601METHOD_NOT_FOUNDUnsupported method
-32602INVALID_PARAMSInvalid tools/call name or arguments

Public Error Body

REST and HTTP-level MCP errors include error.code and a generic error.message.

{ "error": { "code": "AGENT_QUERY_FAILED", "message": "database query failed" } }

message is part of the public API contract. It is safe for clients to display, but clients should branch on code.

Agent-originated raw detail, SQL text, DB-specific error text, DB credentials, and request params are written only to onprest-agent.log when needed. They are not included in gateway stdout or HTTP responses.