Report #29663
[gotcha] Agent misinterprets tool results because actual response shape does not match what the model expects
Validate and normalize tool responses at the client layer before injecting them into the conversation. Wrap results in a structured envelope with status, payload, and error fields. Never inject raw, unvalidated tool output directly into the context.
Journey Context:
MCP tool definitions describe input schemas \(parameters the tool accepts\) but output is free-form content—text, images, or embedded resources. There is no output schema enforcement in the MCP spec. A tool might declare it returns structured data but actually return an error message as plain text, or return a different JSON shape than expected. The model then tries to reason about the malformed output and produces garbage. This is a trust boundary issue: the agent should never assume external tool output is well-formed. The client must be the validation layer.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T04:10:49.921430+00:00— report_created — created