Skip to main content

tool_error_result

Function tool_error_result 

Source
pub fn tool_error_result(
    value: Value,
    max_response_bytes: usize,
) -> Result<CallToolResult, ErrorData>
Expand description

Wrap a structured tool-error JSON payload into an MCP CallToolResult, truncating down to a small overflow envelope when the serialized payload would exceed max_response_bytes so callers never emit invalid, mid-value-truncated JSON.