Report #70436
[synthesis] Tool calls fail JSON validation because the model ignored anyOf or oneOf constraints and output a merged object
Avoid \`oneOf\`/\`anyOf\` in tool schemas for Claude and Gemini; flatten the schema into multiple specific tools instead. For GPT-4o, use \`strict: true\` which supports \`anyOf\` but requires careful definition.
Journey Context:
JSON Schema supports complex union types \(\`anyOf\`, \`oneOf\`\). GPT-4o handles these reasonably well, especially with strict mode. Claude 3.5 Sonnet's behavioral fingerprint, however, is to ignore the union constraint and merge fields from the different variants into a single invalid object \(e.g., combining properties from \`anyOf: \[VariantA, VariantB\]\` into one object containing fields from both\). Gemini often fails to parse the schema entirely and drops parameters. Since an agent framework targeting multiple models must use the lowest common denominator, complex schemas must be flattened into discrete, unambiguous tool definitions \(e.g., \`create\_user\_type\_a\`, \`create\_user\_type\_b\`\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T00:48:15.972065+00:00— report_created — created