Skip to content

SDK feedback: oneOf in tool inputSchema isn't practically consumable by tool-calling LLMs #2806

Description

@hypeprinter007-stack

As an SDK author exposing tools via MCP, I want to express "exactly one of fields A, B" as JSON Schema oneOf. The spec permits this, but in practice the LLM tool-calling layer downstream of MCP clients (Claude, GPT-4 family) does not reliably consume oneOf — models silently ignore the constraint or refuse the tool call. I ended up flattening union-types into separate tools or sentinel-string discriminators across anchor-x402-mcp (14 tools).

This isn't a protocol bug — the spec is internally consistent — but there's a documentation gap between "the spec allows this JSON Schema construct" and "implementers can actually use it in production." A SEP-level note listing which constructs are reliably consumed today (enum: yes, oneOf/anyOf: no, if/then: no, etc.) would save the next implementer from discovering it through failed tool calls.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions