{"record":{"id":"d264734739c108ae","repo":"tinyhumansai/openhuman","slug":"mcp-response-missing-result-payload","errorCode":null,"errorMessage":"MCP response missing `result`: {payload}","messagePattern":"MCP response missing `result`: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/mcp/http_client/client.rs","lineNumber":817,"sourceCode":"            }\n            match frame {\n                Some(data) => data,\n                // Stream ended without a data frame — fall back to the whole-body\n                // parser for a clear \"no data frame\" error that includes the body.\n                None => parse_sse_message(&String::from_utf8_lossy(&raw))?,\n            }\n        } else {\n            let text = response.text().await?;\n            serde_json::from_str(&text).map_err(|e| {\n                anyhow::anyhow!(\"Failed to parse MCP JSON response: {e} — body: {text}\")\n            })?\n        };\n        if let Some(err) = payload.get(\"error\") {\n            anyhow::bail!(\"MCP error: {err}\");\n        }\n        let result = payload\n            .get(\"result\")\n            .ok_or_else(|| anyhow::anyhow!(\"MCP response missing `result`: {payload}\"))?\n            .clone();\n        Ok(ResponseEnvelope {\n            result,\n            session_id: header_to_string(&headers, HEADER_SESSION_ID),\n        })\n    }\n}\n\n#[cfg(test)]\n#[path = \"client_tests.rs\"]\nmod tests;\n","sourceCodeStart":799,"sourceCodeEnd":829,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/mcp/http_client/client.rs#L799-L829","documentation":"A parsed MCP response payload had no \"result\" member (and no \"error\", checked immediately after). The frame is JSON but not a well-formed JSON-RPC response — a protocol violation by the HTTP server or a garbled SSE data frame.","triggerScenarios":"Thrown at src/openhuman/mcp/http_client/client.rs:817 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Log the payload to correlate it with the request that produced it","Verify the server emits complete JSON-RPC envelopes (id, result/error)","Retry once — transient framing corruption can produce this"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}