Skip to content

MCP tools with no arguments fail with "Tool call not found" when using OpenAI (compatible) API #48955

@dastrobu

Description

@dastrobu

Reproduction steps

When calling an MCP tool that takes no arguments via an OpenAI (compatible) API provider, Zed fails with a "Tool call not found" error. The underlying issue is that an empty string "" is parsed as JSON, which fails — serde_json::from_str("") returns an error since an empty string is not valid JSON.

Steps to Reproduce

  1. Install the test MCP server:

    cargo install --git https://github.com/dastrobu/mcp-fail-server
    
  2. Add to Zed settings to enable the server:

    {
      "context_servers": {
        "mcp-fail-server": {
          "command": "mcp-fail-server",
          "args": []
        }
      }
    }
  3. Select an OpenAI (compatible) API provider in the assistant panel (e.g., configure an OpenAI-compatible endpoint). This does not reproduce with Copilot, which already handles empty arguments correctly.

  4. Open the assistant panel and ask it to use the succeed tool (which takes no arguments).

Current vs. Expected behavior

The tool call should succeed. When a tool takes no arguments, the LLM returns an empty arguments string, which should be treated as equivalent to {} (an empty JSON object).

The assistant responds with "I'll call the succeed tool for you." but the tool call fails with "Tool call not found".

Zed version and system specs

Zed: v0.222.4+stable.147.b385025df963c9e8c3f74cc4dadb1c4b29b3c6f0 (Zed)
OS: macOS 26.2
Memory: 64 GiB
Architecture: aarch64

Attach Zed log file

Zed.log

Relevant Zed settings

settings.json

Relevant Keymap

keymap.json

(for AI issues) Model provider details

  • OpenAI (compatible)
  • anthropic/claude-sonnet-4.5

If you are using WSL on Windows, what flavor of Linux are you using?

None


There are several open issues related to "Tool call not found" — some of these may share this root cause:

https://github.com/zed-industries/zed/issues?q=is%3Aissue%20state%3Aopen%20Tool%20call%20not%20found

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:ai/mcpModel Context Protocolarea:ai/openai compatibleAI Feedback for OpenAI Compatiblefrequency:commonBugs that happen for at least a third of the users across all platforms and kinds of usagepriority:P2Average run-of-the-mill bugs

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions