Report #11356
[gotcha] LLM hallucinates invalid tool parameters when JSON schema lacks strict constraints
Define tool input schemas with strict enum values, required arrays, and additionalProperties: false to constrain LLM generation and prevent invalid tool calls.
Journey Context:
It is easier to define loose JSON schemas for tools, assuming the LLM will figure it out. In reality, LLMs treat loose schemas as creative writing prompts. If a parameter expects a specific format or set of values, omitting enum or pattern constraints leads to the LLM passing invalid data, resulting in tool execution errors. Strict schemas act as guardrails, drastically reducing the error rate of tool invocations.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T13:10:39.192489+00:00— report_created — created