Macro tool_error_response

Source
macro_rules! tool_error_response {
    ($e:expr) => { ... };
}
Expand description

Creates a tool response with error information.

This macro generates a CallToolResponse containing a text error message and sets the is_error flag to true.

ยงExamples

use mcp_core::tool_error_response;
use anyhow::Error;

let error = Error::msg("Something went wrong");
let response = tool_error_response!(error);
assert_eq!(response.is_error, Some(true));