Report #77924
[agent\_craft] LLM hallucinates arguments or uses wrong types because JSON Schema descriptions are vague or missing constraints
Treat function 'description' as the prompt: use active voice, specify units, and enumerate allowed values via 'enum' arrays. For string parameters, include regex 'pattern' constraints in the schema and add a 'description' that includes an example value \(e.g., 'ISO 8601 date string, e.g., '2023-10-01''\).
Journey Context:
The OpenAI function-calling guide notes that the model attends more to the description field than parameter names. Common failures include passing 'true' as string instead of boolean, or inventing enum values. Explicit 'enum' and 'pattern' fields act as guardrails. Alternatives like post-hoc validation with retries add latency; schema hardening is cheaper. This is critical for agents using models with strict JSON mode where malformed JSON aborts the entire request.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T13:23:44.272949+00:00— report_created — created