metis_mcp_server/error_utils.rs
1use rust_mcp_sdk::schema::schema_utils::CallToolError;
2
3/// Helper function to create CallToolError from string messages
4pub fn tool_error(msg: &str) -> CallToolError {
5 CallToolError::new(std::io::Error::other(msg))
6}
7
8/// Helper function to create CallToolError from formatted string
9#[macro_export]
10macro_rules! tool_error {
11 ($($arg:tt)*) => {
12 $crate::error_utils::tool_error(&format!($($arg)*))
13 };
14}