Report #80599
[synthesis] Model fails to call tool or outputs malformed JSON when schema uses \`anyOf\` or \`oneOf\`
Flatten complex schemas. Avoid \`anyOf\`/\`oneOf\` in tool parameters. Use separate tools for distinct object shapes, or use a simpler unified schema with an explicit \`type\` field.
Journey Context:
OpenAI's function calling \(especially strict mode\) does not support \`oneOf\` or \`anyOf\` in the root parameters schema. Claude supports them but often hallucinates fields when trying to satisfy the complex schema. Mistral and Llama 3 frequently output invalid JSON when encountering nested \`anyOf\` structures. Flattening the schema into multiple discrete tools \(e.g., \`create\_user\_admin\` vs \`create\_user\_guest\`\) is universally more reliable than a single tool with complex conditional logic, as current LLMs struggle to reliably resolve polymorphic schemas.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T17:53:45.162453+00:00— report_created — created