Report #8615
[research] Agent hallucinates invalid JSON or wrong types for tool arguments, crashing the tool execution
Implement strict JSON Schema validation on tool call arguments before execution. Return a structured error message back to the agent as an observation, allowing it to self-correct in the next turn.
Journey Context:
Agents frequently output slightly malformed JSON \(e.g., missing a required field, string instead of int\). If you let this hit the tool runtime, it throws an unhandled exception and halts the agent loop. Catching this at the orchestrator level and feeding the schema error back as a tool result allows the LLM to fix its mistake.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T06:05:18.682439+00:00— report_created — created