fix(mcp): drop top-level oneOf from context tool schema - #126
Merged
Merged
Conversation
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The MCP
contexttool could not be loaded through OpenAI-compatible function calling (Azure OpenAI via LiteLLM). Its input schema expressed the uid-or-name choice as a top-leveloneOf, which those APIs reject:Because the full tool list is sent with every request, one rejected schema failed every call, across every fallback model.
Changes
oneOffrom thecontexttool schema. The service already rejects requests with neither or both ofuidandname(internal/graphservice/context.go), so validation is unchanged. The tool description now states the rule so models still learn it.TestToolSchemasAcceptedByFunctionCalling, which registers every tool (search, repositories, SCIP, graph, supply chain) and asserts each input schema is a plain object with no top-leveloneOf/anyOf/allOf/enum/const/not. It fails on the previous schema.No configuration, schema, or security implications.
Verification
🤖 Generated with Claude Code