use thiserror::Error;
#[derive(Debug, Error)]
pub enum ToolProviderError {
#[error("Tool '{0}' not found")]
ToolNotFound(String),
#[error("Service '{0}' not found")]
ServiceNotFound(String),
#[error("Failed to connect to service '{service}': {message}")]
ConnectionFailed { service: String, message: String },
#[error("Tool execution failed: {0}")]
ExecutionFailed(String),
#[error("Authorization failed: {0}")]
AuthorizationFailed(String),
#[error("Configuration error: {message}")]
ConfigurationError { message: String },
#[error("Configuration unavailable: {message}")]
Config {
message: String,
#[source]
source: Box<dyn std::error::Error + Send + Sync>,
},
#[error("Internal error: {0}")]
Internal(String),
}
pub type ToolProviderResult<T> = Result<T, ToolProviderError>;