Skip to main content

envelope

Function envelope 

Source
pub fn envelope(code: &str, message: impl Into<String>, details: Value) -> Value
Expand description

Build the uniform { code, message, details } envelope used on both the warning wire (WarningHint’s custom Serialize) and the MCP error wire (tool_error_with_payload payloads in engine_err_with_suggestions). Agents and other decoders branch on code (UPPER_SNAKE_CASE, stable) and parse details by code when they need structured fields.