Overview
ACP uses JSON-RPC 2.0 error codes to communicate errors between clients and agents. This page lists all standard and ACP-specific error codes used in the protocol.Standard JSON-RPC Error Codes
These error codes are defined by the JSON-RPC 2.0 specification.ACP-Specific Error Codes
These error codes are specific to the Agent Client Protocol.Error Code Ranges
JSON-RPC 2.0 reserves specific ranges for different types of errors:-32768to-32000: Reserved for JSON-RPC specification errors-32099to-32000: Server error range (implementation-defined)- Custom application errors: Should use codes outside the reserved range
Usage Examples
Parse Error (-32700)
Invalid Request (-32600)
Method Not Found (-32601)
Invalid Params (-32602)
Internal Error (-32603)
Authentication Required (-32000)
Resource Not Found (-32002)
Error Handling Best Practices
1. Use Specific Error Codes
Choose the most specific error code for the situation:2. Include Helpful Error Data
Provide additional context in thedata field:
3. Handle Errors Gracefully
Catch and convert errors appropriately:4. Document Custom Error Codes
If you define custom error codes (outside the reserved range), document them clearly:See Also
- RequestError Class - Error class API reference
- JSON-RPC Types - JSON-RPC type definitions
- JSON-RPC 2.0 Specification - Official error object specification