mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-09-19 13:23:50 +03:00
Anthropic's Messages API rejects a tool whose `input_schema` carries a composition keyword at the root with: tools.N.custom.input_schema: input_schema does not support oneOf, allOf, or anyOf at the top level The refusal happens before inference, so a single MCP/agent tool carrying a root-level union fails every request that ships the catalog, and combo failover cannot recover from it. Both conversion paths that build a Claude `input_schema` from a client payload now flatten such a root union into a plain object schema: object-compatible branches contribute their `properties` (root wins on a name collision), the root is pinned to `type: "object"`, and only `allOf` contributes `required` — `anyOf`/`oneOf` branch requirements are alternatives and promoting them would refuse calls the original schema accepts. Nested unions are untouched and clean schemas pass through unchanged. Closes #13552