Skip to content

[Bug] 400 Bad request with Gemini while using Opencode - parameters.value schema missing type field #572

@ATLALALA

Description

@ATLALALA

Issue Description

When using Gemini in OpenCode, an INVALID_ARGUMENT error is triggered regardless of whether UnityMcp tools are used, preventing messages from being sent.

Full Error Message:

Bad Request: [{
  "error": {
    "code": 400,
    "message": "Unable to submit request because `unityMCP_manage_components` functionDeclaration `parameters.value` schema didn't specify the schema type field. Learn more: https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/function-calling",
    "errors": [
      {
        "message": "Unable to submit request because `unityMCP_manage_components` functionDeclaration `parameters.value` schema didn't specify the schema type field. Learn more: https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/function-calling",
        "domain": "global",
        "reason": "badRequest"
      }
    ],
    "status": "INVALID_ARGUMENT"
  }
}
]

Steps to Reproduce

Start the UnityMcp server and enable UnityMCP in OpenCode.
Use Gemini 3 pro preview in OpenCode.
Gemini returns a 400 INVALID_ARGUMENT error.

Additional Context

This issue only affects Gemini on my end; models like GPT and GLM are not affected. I have not tested whether ClaudeCode is affected.
There are no errors reported in the Unity Console or the server terminal.

Supplement

In the UnityMCP configuration, I used localHTTP and had a VPN enabled, which might also have caused an impact.

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