pub enum ErrorKind {
Show 26 variants
ToolNotFound,
ToolExecutionFailed,
PromptNotFound,
ResourceNotFound,
ResourceAccessDenied,
CapabilityNotSupported,
ProtocolVersionMismatch,
UserRejected,
Validation,
BadRequest,
Internal,
Serialization,
Protocol,
Authentication,
PermissionDenied,
Transport,
Timeout,
Unavailable,
RateLimited,
ServerOverloaded,
Configuration,
ExternalService,
Cancelled,
Security,
Handler,
NotFound,
}Expand description
Error classification for programmatic handling
Variants§
ToolNotFound
Tool not found (MCP error code -32001)
ToolExecutionFailed
Tool execution failed (MCP error code -32002)
PromptNotFound
Prompt not found (MCP error code -32003)
ResourceNotFound
Resource not found (MCP error code -32004)
ResourceAccessDenied
Resource access denied (MCP error code -32005)
CapabilityNotSupported
Capability not supported (MCP error code -32006)
ProtocolVersionMismatch
Protocol version mismatch (MCP error code -32007)
UserRejected
User rejected the request (MCP error code -1)
Per MCP 2025-06-18 specification, this indicates a user explicitly rejected a sampling request or similar operation. This is a permanent failure that should not be retried.
Validation
Input validation failed (JSON-RPC -32602)
BadRequest
Request was malformed or invalid (JSON-RPC -32600)
Internal
Server internal error (JSON-RPC -32603)
Serialization
Serialization/deserialization error (JSON-RPC -32602)
Protocol
Protocol violation or incompatibility (JSON-RPC -32601)
Authentication
Authentication or authorization failed
PermissionDenied
Operation is not permitted
Transport
Network or transport error
Timeout
Operation timed out
Resource is temporarily unavailable
RateLimited
Rate limit exceeded (MCP error code -32009)
ServerOverloaded
Server overloaded (MCP error code -32010)
Configuration
Configuration error
ExternalService
External dependency failed
Cancelled
Operation was cancelled
Security
Security violation or constraint failure
Handler
Generic handler execution error (deprecated - use specific error kinds)
Replaced by:
ToolExecutionFailedfor tool errorsPromptNotFoundfor prompt errorsResourceNotFoundorResourceAccessDeniedfor resource errors
NotFound
Generic not found error (deprecated - use specific error kinds)
Replaced by:
ToolNotFoundfor toolsPromptNotFoundfor promptsResourceNotFoundfor resources
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ErrorKind
impl<'de> Deserialize<'de> for ErrorKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Copy for ErrorKind
impl Eq for ErrorKind
impl StructuralPartialEq for ErrorKind
Auto Trait Implementations§
impl Freeze for ErrorKind
impl RefUnwindSafe for ErrorKind
impl Send for ErrorKind
impl Sync for ErrorKind
impl Unpin for ErrorKind
impl UnwindSafe for ErrorKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.