Report #82534
[synthesis] Tool call fails downstream validation because model outputs a value semantically close but not strictly matching the JSON schema enum
Do not rely on the LLM to strictly adhere to JSON schema enums. Map model outputs to enum values using fuzzy matching or a normalization dictionary on the client side before executing business logic.
Journey Context:
GPT-4o is highly compliant with JSON schema enums; if an option isn't in the list, it usually picks the closest one or refuses. Claude 3.5 Sonnet takes semantic liberties—if the user implies a state not in the enum, Claude might output a synonym or a slightly modified string that makes sense contextually but violates the schema. Gemini might append extra whitespace to the enum value. Because strict schema validation fails across all these edge cases, client-side normalization is the only robust solution.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T21:07:29.406847+00:00— report_created — created