Skip to content

Error Codes

AHP uses JSON-RPC 2.0 error codes. In addition to the standard JSON-RPC codes, AHP defines application-specific error codes in the -32000 to -32099 range.

JSON Schema: errors.schema.json

Standard JSON-RPC Codes

These codes are defined by the JSON-RPC 2.0 specification:

CodeNameDescription
-32700Parse errorInvalid JSON
-32600Invalid requestNot a valid JSON-RPC request
-32601Method not foundUnknown method name
-32602Invalid paramsInvalid method parameters
-32603Internal errorUnspecified server error

AHP Application Codes

CodeNameDescription
-32001SessionNotFoundThe referenced session URI does not exist
-32002ProviderNotFoundThe requested agent provider is not registered
-32003SessionAlreadyExistsA session with the given URI already exists
-32004TurnInProgressThe operation requires no active turn, but one is in progress
-32005UnsupportedProtocolVersion
-32006ContentNotFoundThe requested content URI does not exist
-32007AuthRequired
-32008NotFoundThe requested file, folder, or URI does not exist
-32009PermissionDenied
-32010AlreadyExists

Error Response Format

All error responses follow the JSON-RPC 2.0 error format:

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32002,
    "message": "No agent registered for provider 'unknown'",
    "data": {}
  }
}

The data field is OPTIONAL and MAY contain additional structured information about the error. Its shape is not defined by the protocol.

Version Introduction

All error codes listed above were introduced in protocol version 1.

Released under the MIT License.