Skip to content

fix(mcp): remove top-level anyOf from check_index_coverage schema - #1525

Merged
DeusData merged 1 commit into
DeusData:mainfrom
DaveMurray-AIGuys:fix/1524-check-index-coverage-anyof-schema
Aug 11, 2026
Merged

fix(mcp): remove top-level anyOf from check_index_coverage schema#1525
DeusData merged 1 commit into
DeusData:mainfrom
DaveMurray-AIGuys:fix/1524-check-index-coverage-anyof-schema

Conversation

@DaveMurray-AIGuys

Copy link
Copy Markdown
Contributor

Fixes #1524

Problem

check_index_coverage's inputSchema had a top-level anyOf:

"required":["project"],"anyOf":[{"required":["paths"]},{"required":["scopes"]}]

Anthropic (Claude), AWS Bedrock, Google Vertex/Gemini, and Azure OpenAI reject custom tool schemas containing a top-level oneOf/allOf/anyOf. Once this tool's schema reaches the model (e.g. after tools/list), the provider rejects the request outright, breaking every tool call in the session for MCP clients backed by those providers.

Fix

  • Removed the top-level anyOf from check_index_coverage's inputSchema.
  • The "at least one of paths or scopes" requirement was already enforced independently at runtime in handle_check_index_coverage (path_count == 0U && scope_count == 0U rejection), so no validation is lost.
  • Moved the requirement into the tool description and the paths/scopes property descriptions so it's still discoverable by callers.
  • No other tool schema in src/mcp/mcp.c uses oneOf/allOf/anyOf (verified via grep), so this was the only occurrence of the defect.

Testing

  • make -f Makefile.cbm cbm — clean build.
  • make -f Makefile.cbm test-focused TEST_SUITES=mcp (ASan+UBSan) — 192 passed, 2 skipped (Windows-only), 0 failed, including all 6 tool_check_index_coverage_* tests exercising paths/scopes/error paths.
  • Manually verified via stdio JSON-RPC (tools/list) that the live inputSchema for check_index_coverage no longer contains anyOf, only "required":["project"].
  • scripts/check-dco.sh origin/main..HEAD passes.

This is a one-file, no-behavior-change fix (schema only); scope is limited to the bug fix per the "bug fixes ... welcome without prior discussion" exception in CONTRIBUTING.md, and #1524 documents the root cause and repro for maintainer review.

check_index_coverage's inputSchema declared a top-level anyOf requiring
either 'paths' or 'scopes'. Anthropic (Claude), AWS Bedrock, Google
Vertex/Gemini, and Azure OpenAI all reject custom tool input schemas
containing a top-level oneOf/allOf/anyOf, so any MCP client backed by
one of these providers fails once this tool's schema reaches the model
(e.g. Claude: 'tools.N.custom.input_schema: ... anyOf is not supported
at the top level'), breaking every tool call in the session.

handle_check_index_coverage already enforces 'at least one of paths or
scopes' at runtime independently of the JSON Schema (path_count == 0
&& scope_count == 0 rejection), so dropping the schema-level anyOf does
not weaken validation. The requirement is now stated in the tool
description and in the paths/scopes property descriptions instead.

Fixes DeusData#1524

Signed-off-by: DaveMurray-AIGuys <264998796+DaveMurray-AIGuys@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

Thanks for opening this — it has been seen, and it is queued.

This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence.

Current review status: working through a backlog. 0.9.1-rc.1 is out, so the release freeze that held reviews is over — but it left a large queue of open pull requests behind it, and we are reading through them oldest-first. The background is in discussion #1144.

What that means for this PR, concretely:

  • It will not be closed for inactivity. No stale bot touches pull requests here.
  • It may still sit a while before a human reads it. That is on us, not on you.
  • Older PRs are read first, so a recent one is not being skipped — it is behind a queue.

Things that will genuinely speed it up whenever review does happen:

  • Keep it rebased on main — the tree is moving quickly right now, and a conflicting branch cannot be reviewed as the diff you intended.
  • Get CI green, or say which failures you believe are pre-existing.
  • Keep the change to one claim. Bundled features and refactors get split before they get merged, which costs you a round trip.
  • Every commit needs a sign-off (git commit -s) — CI enforces DCO.

If this fixes a bug, a reproduction we can run is worth more than a description of the symptom.

Thanks for contributing, and sorry in advance for the wait.

@DeusData
DeusData merged commit 7b3ba57 into DeusData:main Aug 11, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

check_index_coverage tool schema uses a top-level anyOf, rejected by Claude/Bedrock/Vertex/Azure custom tool schemas

2 participants