error
MCP Protocol Errors
Section titled “MCP Protocol Errors”Comprehensive error handling for MCP protocol operations
- JSON-RPC 2.0 compliant error codes
- Integration with protocol_transport_core error system
- Authentication and authorization error handling
Type Aliases
Section titled “Type Aliases”McpResult
Section titled “McpResult”type McpResult = Result<T, McpError>;Result type for MCP operations
McpError
Section titled “McpError”MCP-specific errors
Variants
| Variant | Description |
|---|---|
JsonRpc(String) | |
Authentication(String) | |
Authorization(String) | |
ToolNotFound(String) | |
ToolExecutionFailed(String) | |
MemoryOperationFailed(String) | |
InvalidToolParameters(String) | |
ProtocolVersionMismatch { ... } | |
UnsupportedCapability(String) | |
Timeout(String) | |
ExternalServerError(String) | |
Transport(protocol_transport_core::TransportError) | |
Protocol(protocol_transport_core::ProtocolError) | |
Serialization(serde_json::Error) |
Methods
is_retryable
Section titled “is_retryable”fn is_retryable(&self) -> boolCheck if error is retryable
is_auth_error
Section titled “is_auth_error”fn is_auth_error(&self) -> boolCheck if error is due to authentication
to_jsonrpc_code
Section titled “to_jsonrpc_code”fn to_jsonrpc_code(&self) -> i32Convert to JSON-RPC error code