zed icon indicating copy to clipboard operation
zed copied to clipboard

AI: Any Google AI model API call fails if MCP servers are enabled in the Agent Panel

Open adamveld12 opened this issue 5 months ago • 0 comments

Summary

When using Agent Panel and turning on any MCP servers, sending a prompt the Google AI API will return a 400 GenerateContentRequest.tools[0].function_declarations[14].parameters.required[0]: property is not defined.

Description

Steps to trigger the problem:

  1. Agent Panel -> Settings -> Add 1 MCP server and enable it.
  2. Agent Panel -> Settings -> Enable Google AI following steps described here: https://zed.dev/docs/ai/configuration#google-ai
  3. Agent Panel -> New Thread -> Select any Google AI model -> Send a prompt.

Actual Behavior: Receive a 400 API response, the payload is as follows:

Error interacting with language model
failed to stream completion
error during streamGenerateContent, status code: 400, body: {
  "error": {
    "code": 400,
    "message": "* GenerateContentRequest.tools[0].function_declarations[14].parameters.required[0]: property is not defined\n",
    "status": "INVALID_ARGUMENT"
  }
}

Expected Behavior: Some LLM output. Tool usage should work if prompted, since zed's docs say Google AI supports tools: Image

Model Provider Details

  • Provider: Google AI via Key
  • Model Name: Any model. In this particular example I used Gemini 2.0 Flash
  • Mode: Agent Panel
  • MCP Servers in-use: Any MCP server at all, but for this repro I used @yokingma/time-mcp
  • Other Details:
    • It does not matter if you prompt the LLM to invoke a tool or not. Any API call fails if any MCP server is enabled.
    • If you disable all MCP servers you get a successful response as expected.
    • Text Threads work with Google AI 🥇

Zed Version and System Specs

Zed: v0.188.4 (Zed) OS: macOS 15.3.0 Memory: 32 GiB Architecture: aarch64

adamveld12 avatar May 30 '25 16:05 adamveld12