Public declaration syntax from forge-rs/crates/forge-tool/src/error.rs Original source SHA-256: d9e1be312229b153fe0d4b430038f70412fc469adaec34a7a227a245cd758e7b Function bodies and constant values are omitted. This is not the complete implementation. Source line 31 #[derive(Debug, Error)] pub enum ForgeToolError { /// A tool was looked up by name but does not exist in the registry. /// /// # Remediation /// /// Register the tool with [`crate::registry::ToolRegistry::register`] before use. #[error("tool '{name}' not found in registry; register it with ToolRegistry::register() before invoking")] ToolNotFound { /// The tool name that was looked up. name: String, }, /// A tool execution failed at runtime. /// /// This wraps errors produced by [`crate::execution::ToolExecutor`] implementations. #[error("tool '{name}' execution failed: {reason}")] ExecutionFailed { /// The tool that failed. name: String, /// What went wrong during execution. reason: String, }, /// A tool invocation was denied by the approval handler. /// /// See ANVIL Spec SS8.6 -- the approval step is mandatory in the tool execution lifecycle. #[error("tool '{name}' invocation denied by approval handler: {reason}")] ApprovalDenied { /// The tool that was denied. name: String, /// Why the invocation was denied. reason: String, }, /// Schema validation failed for tool arguments. /// /// The arguments provided to a tool call did not conform to the tool's /// declared parameter schema. #[error("schema validation failed for tool '{name}' at path '{path}': {reason}")] SchemaValidation { /// The tool whose schema was violated. name: String, /// JSON pointer path to the failing field. path: String, /// Human-readable description of what was expected. reason: String, }, /// A tool was registered or invoked with an incorrect tier classification. /// /// See ANVIL Spec SS8.1--8.4 -- tool tier classification is immutable. #[error( "tool '{name}' has invalid tier: expected {expected}, got {actual} (see ANVIL Spec SS8.1)" )] InvalidTier { /// The tool whose tier is mismatched. name: String, /// The expected tier classification. expected: String, /// The actual tier classification provided. actual: String, }, /// A registry operation failed (e.g., duplicate registration, capacity exceeded). #[error("tool registry error: {reason}")] RegistryError { /// What went wrong with the registry operation. reason: String, }, } Source line 103 pub type ForgeToolResult = Result;