tinyhumansai/openhuman · error · anyhow::Error

MCP response missing `result`: {payload}

Error message

MCP response missing `result`: {payload}

What it means

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.

Source

Thrown at src/openhuman/mcp/http_client/client.rs:817

            }
            match frame {
                Some(data) => data,
                // Stream ended without a data frame — fall back to the whole-body
                // parser for a clear "no data frame" error that includes the body.
                None => parse_sse_message(&String::from_utf8_lossy(&raw))?,
            }
        } else {
            let text = response.text().await?;
            serde_json::from_str(&text).map_err(|e| {
                anyhow::anyhow!("Failed to parse MCP JSON response: {e} — body: {text}")
            })?
        };
        if let Some(err) = payload.get("error") {
            anyhow::bail!("MCP error: {err}");
        }
        let result = payload
            .get("result")
            .ok_or_else(|| anyhow::anyhow!("MCP response missing `result`: {payload}"))?
            .clone();
        Ok(ResponseEnvelope {
            result,
            session_id: header_to_string(&headers, HEADER_SESSION_ID),
        })
    }
}

#[cfg(test)]
#[path = "client_tests.rs"]
mod tests;

View on GitHub (pinned to 7491200858)

Solutions

  1. Log the payload to correlate it with the request that produced it
  2. Verify the server emits complete JSON-RPC envelopes (id, result/error)
  3. Retry once — transient framing corruption can produce this
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src/openhuman/mcp/http_client/client.rs:817 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/d264734739c108ae. Report an issue: GitHub.