Skip to content

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

Open

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

  1. self-assigned this
    on May 27, 2026
  2. olaservo commented on May 27, 2026

    @olaservo
    Member

    Assigning this one to myself as a follow up to SEP-2106. I was having a related conversation with @evalstate recently and I agree that we should put something together to cover the mismatch between what LLM providers actually support vs what the spec allows. It might not belong in the spec itself, but there should be more details on this somewhere adjacent to the spec, so that implementers don't run into it through trial and error.

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