Report #16749
[research] Agent passes malformed JSON or wrong types to tool arguments, crashing the tool execution
Enforce strict JSON Schema validation on agent tool call outputs before executing the tool. If validation fails, return a structured error back to the agent as an observation, allowing it to self-correct, rather than failing the run.
Journey Context:
LLMs frequently hallucinate tool arguments \(e.g., passing a string where an integer is expected, or missing required fields\). If you just try to execute the tool, the runtime crashes. If you silently coerce types, you get silent bugs. The robust pattern is to validate the LLM's generated tool call against the schema, and if it fails, feed the validation error back into the agent's context. This turns a fatal error into a self-healing step, observable via a spike in tool\_validation\_error spans.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T03:39:40.879375+00:00— report_created — created