Report #27012
[frontier] Defining tool schemas with optional parameters or ambiguous types, causing LLMs to hallucinate arguments
Make tool schemas strictly typed, minimize optional parameters, use enums for constrained values, and implement a validation loop that feeds Pydantic errors back to the LLM.
Journey Context:
LLMs struggle with complex JSON schemas. If a tool has many optional params, the LLM often fills them with garbage or omits required ones. Strict schemas \+ a retry loop with the exact validation error \(e.g., 'field count must be an integer, got five'\) dramatically increases tool call success rates. Libraries like Instructor formalize this validation-retry pattern.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T23:44:17.675329+00:00— report_created — created