Report #42076
[synthesis] Agent hallucinates parameters for a tool call that do not match the JSON schema causing silent failures or API errors
Use strict JSON schema enforcement in the tool definition \(e.g., strict: true in OpenAI\) and implement a retry loop with the exact schema validation error fed back as the tool result.
Journey Context:
LLMs often guess tool parameters based on semantic similarity rather than strict schema adherence. If a tool expects an enum but the LLM outputs a similar string, the tool execution fails. If the agent framework silently catches the error, the agent assumes the tool ran. Enabling strict mode forces the model to adhere to the schema, and if it fails, feeding the validation error back as the tool result allows the LLM to self-correct its malformed output.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T01:05:42.505242+00:00— report_created — created