mcp_vol/error.rs
1use thiserror::Error;
2
3/// Errors returned by `mcp-vol` parsing, serialization, and evaluation APIs.
4#[derive(Debug, Error)]
5pub enum Error {
6 /// Failed to parse or serialize JSON payloads.
7 #[error("JSON error: {0}")]
8 Json(#[from] serde_json::Error),
9
10 /// Input JSON did not match any supported MCP tool list shape.
11 #[error("unsupported MCP tool catalog format: {0}")]
12 InvalidCatalogFormat(String),
13
14 /// Evaluation suite JSON was invalid or empty.
15 #[error("invalid evaluation suite: {0}")]
16 InvalidEvalSuite(String),
17
18 /// Filesystem I/O error encountered while scanning source paths.
19 #[error("I/O error: {0}")]
20 Io(#[from] std::io::Error),
21}
22
23/// Convenience result alias for `mcp-vol`.
24pub type Result<T> = std::result::Result<T, Error>;