Report #45829
[synthesis] Model violates enum constraints in tool schema sending invalid values not in the list
Do not rely solely on JSON schema enums for constraint enforcement. Add the valid enum values directly into the tool description text. For Claude, add 'You MUST choose exactly from \[X, Y, Z\]' to the description.
Journey Context:
Developers define enums in the JSON schema expecting strict adherence. GPT-4o with Structured Outputs \(strict: true\) enforces this perfectly. Without strict mode, or for Claude/Gemini, models often 'extend' enums if they feel the correct value isn't listed \(e.g., sending 'MEDIUM' when the enum is \['SMALL', 'LARGE'\]\). Claude is particularly prone to ignoring schema enums if the description doesn't mention them. Moving the constraints into the natural language description aligns the model's semantic understanding with the schema constraints.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T07:23:49.456056+00:00— report_created — created