#[non_exhaustive]pub enum ToolError {
ToolNotFound {
name: Cow<'static, str>,
},
InvalidParameters {
tool: Cow<'static, str>,
message: Cow<'static, str>,
},
ExecutionFailed {
tool: Cow<'static, str>,
message: Cow<'static, str>,
},
SchemaValidation {
tool: Cow<'static, str>,
message: Cow<'static, str>,
},
RegistrationError {
message: Cow<'static, str>,
},
SerializationError {
tool: Cow<'static, str>,
source: Error,
},
TimeoutError {
tool: Cow<'static, str>,
timeout: Duration,
},
ExecutionPanicked {
tool: Cow<'static, str>,
},
}Expand description
Error returned while registering, validating, or executing a tool.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ToolNotFound
The requested tool is not registered.
InvalidParameters
The supplied parameters were invalid for the tool.
Fields
ExecutionFailed
Tool execution failed at runtime.
Fields
SchemaValidation
The tool’s JSON schema validation failed.
Fields
RegistrationError
Tool registration failed (duplicate name, …).
SerializationError
(De)serialization for a tool payload failed.
TimeoutError
Tool execution exceeded its timeout.
Note: the timeout cancels only the local execution future. For a tool
backed by a remote service (e.g. an MCP tool, or any tool that performs
I/O), the request may already be on the wire and the remote side effect
may still occur. A timed-out call is not cached, and because
TimeoutError is retryable the same call may be issued more than once —
so keep per-call timeouts conservative for non-idempotent tools.
Fields
ExecutionPanicked
A tool handler panicked while it was being polled.
Panic payloads are deliberately omitted because they may contain sensitive data and are not a stable error interface.
Implementations§
Trait Implementations§
Source§impl Error for ToolError
impl Error for ToolError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()