Skip to content

fix(mcp): declare call_tool_* args and code_execution input/options as open objects - #1434

Merged
Dumbris merged 1 commit into
mainfrom
claude/issue-1364-investigation-718fe6
Sep 30, 2026
Merged

Dumbris merged 1 commit into
mainfrom
claude/issue-1364-investigation-718fe6

Conversation

@Dumbris

@Dumbris Dumbris commented Sep 30, 2026

Copy link
Copy Markdown
Member

Summary

Closes #1364

call_tool_read / call_tool_write / call_tool_destructive declared args as {"type":"object","properties":{}} (mcp-go v1.0.0 WithObject always seeds an empty properties map). Grammar-constrained clients such as llama.cpp llama-server compile an empty properties without additionalProperties into an empty-object-only rule, so local models could only ever emit "args": {} and every call failed with missing property ....

Changes

  • New openObject() PropertyOption (internal/server/open_object_schema.go): deletes the empty properties key and sets additionalProperties: true.
  • Applied to:
    • args on the three call_tool_* variants (shared builder, internal/server/mcp.go)
    • input and options on code_execution (internal/server/mcp_routing.go) — same defect, not mentioned in the issue
  • describe_tool.filters is intentionally left closed (it declares its three keys).
  • Regenerated testdata/toolslist_goldens/{default_server,retrieve_tools_mode,code_execution_mode}.json (only "properties": {} → "additionalProperties": true). Frozen pre099/pre105 goldens are untouched; the snapshot and menu-surface tests pin this exact transition and normalise it away for the byte-equal comparisons.
  • Regression test TestOpenObjectParamsAreNotGrammarClosed_Issue1364.

Reviewer notes

  • No server-side behaviour change: the handler already accepts any map for args, and Spec 085 pre-dispatch validation runs against the upstream tool's own schema, not the wrapper.
  • additionalProperties is rejected by some older Gemini function-declaration converters; upstream MCP schemas already carry it, so Gemini-bound clients must already sanitize it.
  • OpenAI strict mode cannot represent an open object in any form; non-strict clients are unaffected.
  • Follow-up (separate PR): renderFullDirectTool on /mcp/all drops an upstream tool's top-level additionalProperties.

…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
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

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

View logs

@github-actions

Copy link
Copy Markdown
Contributor

📦 Build Artifacts

Workflow Run: View Run
Branch: claude/issue-1364-investigation-718fe6

Available Artifacts

  • archive-darwin-amd64 (30 MB)
  • archive-darwin-arm64 (27 MB)
  • archive-linux-amd64 (18 MB)
  • archive-linux-arm64 (16 MB)
  • archive-windows-amd64 (30 MB)
  • archive-windows-arm64 (27 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (25 MB)
  • installer-dmg-darwin-arm64 (22 MB)
  • smart-mcp-proxymcpproxy-goLN12K7.dockerbuild (0 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 36715500154 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Dumbris
Dumbris merged commit c8fd39e into main Sep 30, 2026
44 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.

[Bug]: call_tool_* args schema has empty properties: {} — grammar-constrained clients (llama.cpp) can only send {}

2 participants