pub enum ToolError {
InvalidParams(String),
PolicyRejected(String),
SizeLimitExceeded(String),
Internal(String),
}Expand description
Errors returned from ToolHandler::call.
Each variant maps to a JSON-RPC -32000 application-error response.
The serve loop converts these to the wire format.
Variants§
InvalidParams(String)
The caller supplied parameters that do not match the tool schema.
PolicyRejected(String)
A policy gate returned Reject, Quarantine, or BreakGlass.
Per ADR 0045 §3, a BreakGlass composed outcome is treated as Reject at the MCP boundary. No write occurs when this variant is returned.
SizeLimitExceeded(String)
The incoming payload exceeds the server-side size limit (RT-5).
Internal(String)
An unexpected internal error that is not one of the above categories.
Implementations§
Source§impl ToolError
impl ToolError
Sourcepub const fn kind(&self) -> &'static str
pub const fn kind(&self) -> &'static str
Stable machine-readable refusal class for JSON-RPC error.data.
Sourcepub fn resolution_data(&self) -> Value
pub fn resolution_data(&self) -> Value
Structured operator-facing remediation data for MCP clients.
The human message remains short in error.message; this envelope gives
clients enough deterministic shape to render a useful “what now?”
panel without weakening the refusal or inventing an override path.