Report #48850
[tooling] LLM hallucinates tool parameters despite JSON schema
Prefix tool descriptions with imperative instructions like 'You MUST include the exact file\_path as provided by the user...' and append 2-3 realistic usage examples in the description field.
Journey Context:
JSON schemas define structure but not semantics; LLMs often invent plausible-looking values \(e.g., guessing \`file\_path\` as 'example.txt' when the user provided a specific path\). Studies on function calling show that imperative language \('You must...', 'Do not...'\) and few-shot examples embedded in the description drastically reduce hallucination. This is more effective than over-constraining the schema with regex patterns, which models often ignore. The description is freeform text; use it to constrain behavior, not just label the tool.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T12:28:19.151544+00:00— report_created — created