Skip to content

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

Closed

Description

@2eestunes-tech

What happened?

call_tool_read / call_tool_write / call_tool_destructive declare args as
{"type": "object", "properties": {}} (from mcp.WithObject("args", ...) in internal/server/mcp.go, still
the case on main as of 2026-09-24). Clients that turn tool schemas into a constrained-decoding grammar read an empty
properties map as "an object with no keys allowed", so the model can only ever emit "args": {}. Every call then
fails with missing property 'path' (or similar), and the retry loops forever.

Cloud models (no grammar) are unaffected, which is probably why this has not come up.

Not a duplicate of #982 / PR #988. That fix made upstream tools' own schemas show up correctly in the REST/CLI
listings (supervisor ParamsJSON stub), and it works: retrieve_tools returns full upstream schemas. This issue is the
args parameter of the call_tool_* meta-tools themselves, declared in internal/server/mcp.go, which #988 did not touch.

Expected behavior

The args parameter of call_tool_read / call_tool_write / call_tool_destructive should be declared as an open
object (e.g. {"type":"object","additionalProperties":true}, or with no "properties" key), so clients that compile
tool schemas into a constrained-decoding grammar (llama.cpp llama-server) let the model emit the upstream tool's
arguments, e.g. "args": {"path": "...", "head": 3}.

Actual: the schema is {"type":"object","properties":{}}, which llama.cpp's grammar treats as "no keys allowed",
so the model can only emit "args": {} and every call fails with "missing property 'path'".

Steps to reproduce

1.- mcpproxy v0.66.1 (Windows), /mcp endpoint (retrieve_tools + call_tool_*)
2.- llama.cpp llama-server (OpenAI-compatible /v1/chat/completions with tools), Qwen3.5 9B and Qwen3.6 35B-A3B

Minimal test with the tool schema alone, same prompt, temperature 0, two tries each:

args schema sent to llama.cpp what the model emitted
{"type":"object","properties":{}} (as mcpproxy sends it) "args":{} — both times
{"type":"object"} "args":{"path":"D:/x.md","head":3} — both times
{"type":"object","properties":{},"additionalProperties":true} "args":{"path":"D:/x.md","head":3} — both times

End to end through mcpproxy (5 read-only tasks): with the schema as served, the 35B scored 2 of 5 correct and only
escaped by falling back to args_json after 4–12 empty calls; a 9B model scored 0 of 3. With only that one schema
change made on the client side, the same 35B completed 30 of 30 runs correctly across six sampling settings.

===
Suggested fix

Declare args as an open object, e.g.

mcp.WithObject("args",
    mcp.Description("..."),
    mcp.AdditionalProperties(true),
),

or omit properties for this parameter. Either form lets constrained decoders emit arbitrary keys, and it should not
change behaviour for any other client.

Workaround for others hitting this

Use args_json (string), or strip the empty properties from the schema before handing tools to the model.

MCPProxy version

0.66.1

Operating system

macOS

Relevant logs

mcpproxy doctor?

Yes, on v0.66.1 (windows/amd64, personal edition), 2026-09-25, against the running service:


Version: v0.66.1
✅ All systems operational! No issues detected.
Routing Mode (configured): retrieve_tools
  Endpoints: /mcp/all (direct), /mcp/code (code_execution), /mcp/call (retrieve_tools)
✓ Sensitive Data Detection: enabled (default)


Doctor reports healthy, as expected: all upstreams connect and calls made with args_json succeed. The fault is in
the meta-tool schema the MCP endpoint serves, which doctor doesn't check.

Pre-submission checklist

  • I searched existing issues and did not find a duplicate
  • I ran mcpproxy doctor and reviewed the output

Activity

  1. Dumbris commented on Sep 30, 2026

    @Dumbris
    Member

    Thank you @2eestunes-tech for this excellent report! The minimal A/B table and the root-cause pointer made this very quick to fix.

    Fixed in #1434 (merged). What changed:

    • args on call_tool_read / call_tool_write / call_tool_destructive is now declared as {"type":"object","additionalProperties":true} (no empty properties map).
    • The same fix applies to input and options on code_execution, which had the same problem.

    We reproduced your result locally with llama.cpp llama-server (Qwen3-8B, --jinja, temperature 0, forced tool call) using the real call_tool_read schema:

    Schema Model output
    before "args": {} (3/3)
    after "args": {"path": "D:/notes/x.md", "head": 3} (3/3)

    It will ship in the next release. Until then, args_json remains a working workaround. If you still see empty args with your setup after upgrading, please reopen this issue.

  2. added a commit that references this issue on Oct 1, 2026
    c8fd39e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions