Repository navigation
fix(mcp): declare call_tool_* args and code_execution input/options as open objects - #1434
Merged
Merged
Conversation
…s open objects
mcp-go's WithObject always emits {"type":"object","properties":{}}.
Grammar-constrained clients (llama.cpp llama-server, xgrammar) compile an
empty properties map without additionalProperties as "no keys allowed", so
local models could only send args:{} and every call failed.
Add an openObject() PropertyOption that drops the empty properties map and
sets additionalProperties:true, and apply it to call_tool_* args and
code_execution input/options. Regenerate the tools/list goldens and pin the
exact delta in the snapshot/menu-surface tests.
Closes #1364
Deploying mcpproxy-docs with
|
| Latest commit: |
ba0c5a2
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://2adb9bb2.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://claude-issue-1364-investigat.mcpproxy-docs.pages.dev |
Contributor
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 36715500154 --repo smart-mcp-proxy/mcpproxy-go
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
2 tasks done
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
Closes #1364
call_tool_read/call_tool_write/call_tool_destructivedeclaredargsas{"type":"object","properties":{}}(mcp-go v1.0.0WithObjectalways seeds an emptypropertiesmap). Grammar-constrained clients such as llama.cppllama-servercompile an emptypropertieswithoutadditionalPropertiesinto an empty-object-only rule, so local models could only ever emit"args": {}and every call failed withmissing property ....Changes
openObject()PropertyOption(internal/server/open_object_schema.go): deletes the emptypropertieskey and setsadditionalProperties: true.argson the threecall_tool_*variants (shared builder,internal/server/mcp.go)inputandoptionsoncode_execution(internal/server/mcp_routing.go) — same defect, not mentioned in the issuedescribe_tool.filtersis intentionally left closed (it declares its three keys).testdata/toolslist_goldens/{default_server,retrieve_tools_mode,code_execution_mode}.json(only"properties": {}→"additionalProperties": true). Frozenpre099/pre105goldens are untouched; the snapshot and menu-surface tests pin this exact transition and normalise it away for the byte-equal comparisons.TestOpenObjectParamsAreNotGrammarClosed_Issue1364.Reviewer notes
args, and Spec 085 pre-dispatch validation runs against the upstream tool's own schema, not the wrapper.additionalPropertiesis rejected by some older Gemini function-declaration converters; upstream MCP schemas already carry it, so Gemini-bound clients must already sanitize it.renderFullDirectToolon/mcp/alldrops an upstream tool's top-leveladditionalProperties.