Skip to content

Anthropic API rejects MCP tools with anyOf in input_schema #35516

Closed as not planned

Description

@KamilKleina

Description

Claude models in opencode fails with:
tools.36.custom.input_schema: input_schema does not support oneOf, allOf, or anyOf at the top level
Same error as the one in anthropics/claude-code#4886 (anthropics/claude-code#4886).

OpenCode adds anyOf to the input_schema of some MCP tools. For example, gitnexus_api_impact gets:
"anyOf": [{"required": ["route"]}, {"required": ["file"]}]
The Anthropic API does not allow anyOf (or oneOf/allOf) at the top level of a tool schema. Same restriction as OpenAI.

PR #32489 (#32489) (shipped in v1.17.8) sanitizes tool schemas for OpenAI models by dropping composition keywords. But that sanitization only runs for OpenAI/Azure adapters. It never touches the Anthropic path.

Plugins

gitnexus

OpenCode version

1.17.13

Steps to reproduce

  1. install gitnexus
  2. pick claude models
  3. run anything

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. github-actions commented on Sep 5, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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