Report #12470
[gotcha] Tool selection accuracy drops when using complex JSON Schema features like oneOf or $defs
Flatten tool schemas. Use separate distinct tools for different operations instead of \`oneOf\` to switch modes, and inline all definitions instead of using \`$defs\` or \`allOf\`.
Journey Context:
Developers try to make schemas DRY using \`$defs\` or create 'smart' tools using \`oneOf\` to accept different payload shapes. LLMs struggle to parse these complex schemas, frequently failing to populate the fields correctly or ignoring the tool entirely. Flat, verbose, and slightly repetitive schemas perform significantly better for LLM tool selection than DRY, nested ones.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T16:09:34.772150+00:00— report_created — created