Report #12588
[agent\_craft] Agent generates invalid JSON parameters or hallucinates tool arguments in function calling
Enable strict mode in function definitions to enforce JSON schema compliance at the API level, rejecting non-conforming calls before execution
Journey Context:
Without strict mode, models frequently omit required fields or insert explanatory text into JSON values, causing parser failures. Developers often try to fix this with prompt engineering \('respond with valid JSON only'\), but this is unreliable. Strict mode moves the constraint to the infrastructure layer, guaranteeing schema adherence by constraining the token sampler at the API level. This is superior to post-hoc validation because it prevents the error rather than catching it.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T16:21:39.708937+00:00— report_created — created