Report #101110
[architecture] How do I make LLM tool calls reliable and avoid wrong arguments or broken JSON?
Enable strict mode on every function schema \(additionalProperties:false, all properties required\), keep fewer than ~20 functions visible per turn, write clear names and descriptions, make tools idempotent, and validate arguments server-side. Use structured outputs for final responses, not raw text parsing.
Journey Context:
The most common failure modes are hallucinated arguments, schema drift, and the model calling the wrong tool. JSON mode only guarantees valid JSON, not that fields are correct. Strict mode uses constrained decoding to enforce the schema. Limiting the tool surface reduces decision noise; clear descriptions reduce ambiguity; idempotent tools let you retry safely. Treat tool outputs like untrusted user input—never execute privileged actions without a policy check, even if the model asked for them.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-06T04:59:55.592010+00:00— report_created — created