Report #22950
[gotcha] LLM hallucinates tool parameters due to overly permissive JSON Schema
Define strict enum arrays and pattern constraints in the tool's inputSchema. Avoid generic string types where a constrained set of values exists.
Journey Context:
If a tool accepts a format parameter as a free-text string, the LLM might guess jpeg when the server only accepts jpg. The server rejects it, causing a retry loop. By strictly defining the schema with enum: \["jpg", "png"\], the LLM's token generation is constrained to valid choices. Overly permissive schemas shift the burden of validation to runtime, causing preventable errors, whereas strict schemas act as compile-time guardrails for the LLM's reasoning.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T16:56:02.988462+00:00— report_created — created