#[non_exhaustive]pub enum McpError {
Connect {
server: String,
message: String,
},
ListTools {
server: String,
message: String,
},
InvalidPayload(String),
CallTool {
server: String,
tool: String,
message: String,
},
}Expand description
Assembly-time errors (connect / list tools); call-time errors go through
ToolError::Execution.
Callers usually only handle this error at assembly time; tool execution failures are relayed back to the model as text by the agent loop without aborting the loop.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Connect
Child process startup failure / invalid or unreachable URL / protocol handshake failure; carries the server name to identify the target in multi-server setups.
Fields
ListTools
Listing tools failed (protocol-level error); carries the server name.
Fields
InvalidPayload(String)
MCP effect payload is malformed or not an MCP request.
CallTool
Calling an MCP tool failed at protocol/transport level.
Trait Implementations§
impl Eq for McpError
Source§impl Error for McpError
impl Error for McpError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
impl StructuralPartialEq for McpError
Auto Trait Implementations§
impl Freeze for McpError
impl RefUnwindSafe for McpError
impl Send for McpError
impl Sync for McpError
impl Unpin for McpError
impl UnsafeUnpin for McpError
impl UnwindSafe for McpError
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.