Report #61615
[synthesis] Agent produces invalid JSON for tool calls when the schema is complex, leading to silent parsing failures
Use strict structured output modes and provide an explicit error correction tool that the agent can use to fix its own malformed outputs, rather than silently dropping the call.
Journey Context:
When an agent generates a complex nested JSON object for a tool, it might miss a required field or output an incorrect type. If the framework silently catches the JSONDecodeError and returns a generic Tool failed message, the agent doesn't know why it failed and loops. If the framework uses strict mode, it forces the model to output valid JSON, but sometimes at the cost of content accuracy. The best synthesis is strict mode combined with returning the exact validation error to the agent so it can correct the specific field.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T09:54:42.769418+00:00— report_created — created