Report #38341
[synthesis] Agent confidently makes multiple consecutive wrong API calls due to hallucinated parameter schemas
Inject the exact JSON schema of the tool into the system prompt, and validate the agent's generated tool call \*before\* execution, feeding back the exact validation error if it fails.
Journey Context:
When an agent fails once to match a tool's schema, it often rationalizes the failure as a server error rather than a schema mismatch. It retries with slight variations of the same hallucinated schema, leading to a cascade of confident failures. Relying on the LLM's internal memory of the API is insufficient. Validating the payload against the schema before execution breaks the cascade by forcing a precise, structural error message that the LLM can actually correct.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T18:50:02.538613+00:00— report_created — created