Skip to content

with Gemini Cli : error 404, API error : The GenerateContentRequest proto is invalid:\n * tools[0].function_declarations[12].name: #34

@apohutenumera

Description

@apohutenumera

When lauching gemini cli after installing package and running a prompt: test
I got this error

✕ [API Error: [{
    "error": {
      "code": 400,
      "message": "The GenerateContentRequest proto is invalid:\n  * tools[0].function_declarations[12].name: [FIELD_INVALID] Invalid function name. Must
  start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores, dots and dashes, with a maximum length of 64.",
      "errors": [
        {
          "message": "The GenerateContentRequest proto is invalid:\n  * tools[0].function_declarations[12].name: [FIELD_INVALID] Invalid function name.
  Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores, dots and dashes, with a maximum length of 64.",
          "domain": "global",
          "reason": "badRequest"
        }
      ],
      "status": "INVALID_ARGUMENT"
    }
  }
  ]]

Gemini cli is up to date
Supergemini package too
It seems that it comes from the "magic" MCP :

🟢 magic - Ready (4 tools)
Tools:
- 21st_magic_component_builder
- 21st_magic_component_inspiration
- 21st_magic_component_refiner

If i remove the magic mcp in settings.json and reload gemini cli : ✅ everything is fine. Here is the part i've removed :

"magic": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "@21st-dev/magic"
      ],
      "env": {
        "TWENTYFIRST_API_KEY": ""
      }
    },

See google-gemini/gemini-cli#7664

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions