use thiserror::Error;
#[derive(Debug, Error)]
#[allow(dead_code)] pub enum McpError {
#[error("protocol error: {0}")]
Protocol(String),
#[error("tool not found: {0}")]
ToolNotFound(String),
#[error("invalid params: {0}")]
InvalidParams(String),
#[error("constitutional violation: {0}")]
ConstitutionalViolation(String),
#[error("mcp rule violation: {rule} — {description}")]
McpRuleViolation { rule: String, description: String },
#[error("authentication required")]
AuthenticationRequired,
#[error("internal error: {0}")]
Internal(String),
#[error("io error: {0}")]
Io(#[from] std::io::Error),
#[error("json error: {0}")]
Json(#[from] serde_json::Error),
}
pub type Result<T> = std::result::Result<T, McpError>;