mcpkit_core/error/
codes.rs

1//! Standard JSON-RPC and MCP error codes.
2//!
3//! This module defines error code constants used in JSON-RPC 2.0 responses
4//! and MCP-specific error responses.
5
6/// Invalid JSON was received.
7pub const PARSE_ERROR: i32 = -32700;
8
9/// The JSON sent is not a valid Request object.
10pub const INVALID_REQUEST: i32 = -32600;
11
12/// The method does not exist.
13pub const METHOD_NOT_FOUND: i32 = -32601;
14
15/// Invalid method parameters.
16pub const INVALID_PARAMS: i32 = -32602;
17
18/// Internal JSON-RPC error.
19pub const INTERNAL_ERROR: i32 = -32603;
20
21/// Server error range start.
22pub const SERVER_ERROR_START: i32 = -32000;
23
24/// Server error range end.
25pub const SERVER_ERROR_END: i32 = -32099;
26
27// MCP-specific codes
28
29/// User rejected the operation.
30pub const USER_REJECTED: i32 = -1;
31
32/// Resource was not found.
33pub const RESOURCE_NOT_FOUND: i32 = -32002;