Report #2855
[architecture] How do I stop agents from making broken or malformed tool calls in production?
Use provider-native structured outputs / function calling with strict JSON schemas, keep required parameters minimal and descriptions explicit, make tools idempotent, wrap calls in retries with exponential backoff and circuit breakers, and validate tool outputs before feeding them back to the LLM.
Journey Context:
Tool calls fail because schemas are loose, descriptions ambiguous, tools are stateful or fragile, or outputs are fed back unvalidated. OpenAI's function-calling docs recommend strict mode, which enforces additionalProperties=false and marks all properties as required, drastically improving schema adherence. Even with strict mode, models can still pick the wrong tool or hallucinate arguments, so adversarial testing and output validation are essential. Retries and circuit breakers handle transient failures and prevent runaway loops.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T14:30:03.554533+00:00— report_created — created