mcpproxy-go icon indicating copy to clipboard operation
mcpproxy-go copied to clipboard

[Bug]: profiles tier enum contains an empty string rejected by Gemini

Open expiren opened this issue 1 month ago • 1 comments

What happened?

MCPProxy's built-in profiles tool exports an empty string as the fourth value of inputSchema.properties.tier.enum. Google Gemini rejects the function declaration with HTTP 400 before generating any response, even when the requested task does not call profiles.

This was observed through OpenCode with @cortexkit/opencode-antigravity-auth 2.2.1. OpenCode exposes the tool as mcpproxy_profiles; the raw MCP tool name is profiles.

Verified evidence

An authenticated MCP tools/list request to the running v0.70.0 server returned this property:

"tier": {
  "type": "string",
  "description": "classify: tier to assign; \"\" removes the classification.",
  "enum": ["read", "write", "destructive", ""]
}

The same enum is hardcoded at internal/server/mcp_profiles_tool_schema.go:43 in v0.70.0 and remains in main at ee7834e71c0087fb56e157d6e506d30275785cb5.

The installed Antigravity adapter preserves enum arrays unchanged in toGeminiSchema; it does not introduce this empty value. The exact provider response was:

HTTP 400
* GenerateContentRequest.tools[0].function_declarations[47].parameters.properties[tier].enum[3]: cannot be empty

The declaration index depends on the client's tool ordering. An empty-string enum is legal JSON Schema; this report concerns compatibility with Google's function-declaration validator.

Expected behavior

The built-in tool schema should be usable with Gemini while preserving the ability to remove a tool classification. A non-empty sentinel mapped to the existing internal empty-string reset, or a compatible schema representation with runtime validation, would avoid the incompatibility. Simply removing the enum member without preserving reset semantics would remove existing functionality.

Steps to reproduce

  1. Start MCPProxy v0.70.0 and connect with administrator access, without a restrictive active profile, so profiles is visible.
  2. Initialize an MCP session and call tools/list. Inspect profiles.inputSchema.properties.tier.enum and observe the fourth entry is "".
  3. Connect through a Gemini client that includes this schema in its function declarations (observed with OpenCode and the Antigravity adapter above).
  4. Send a prompt. Google rejects the tool declaration with the HTTP 400 above before any tool invocation.

Configuration and workaround

No supported configuration setting was found that changes this hardcoded enum while preserving the tool. Profile/credential scoping can hide the tool but does not repair its schema. disable_management is not a schema fix: the built-in profiles tool is registered separately and mutating operations are denied at execution time.

OpenCode can exclude mcpproxy_profiles from its model tool list as a temporary workaround, at the cost of losing profile administration through chat. This workaround has not been applied or tested with a subsequent Gemini request in this report.

MCPProxy version

v0.70.0 (running server; not an older executable found elsewhere on disk).

Operating system

Windows.

Pre-submission checklist

  • [x] Searched existing issues and pull requests; did not find a duplicate for the profiles empty tier enum.
  • [ ] Ran mcpproxy doctor for this report (not run).

No credentials, complete client configuration, private session content, or customer data are included.

expiren avatar Oct 11 '26 09:10 expiren

Thanks @expiren for the clear report and the exact Gemini error — that made this quick to fix. The profiles tier enum now uses a non-empty none value (legacy "" still works at runtime), fixed in #1578 and included in the next release.

Dumbris avatar Oct 12 '26 04:10 Dumbris