Skip to main content

render_result

Function render_result 

Source
pub fn render_result(result: &Value) -> String
Expand description

Render an MCP tools/call result as the text the model sees.

Why: MCP returns an array of content frames; the agent loop takes a string. What: joins every text frame with a newline. A result carrying no text frame renders as its own JSON, so a structured-only reply is still visible rather than reported as empty. Test: super::tests::tool_tests::text_frames_are_joined, super::tests::tool_tests::a_frameless_result_renders_as_json.