You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add MCP Schema Compatibility Summary and Update Gemini Compatibility Documentation
- Introduced COMPATIBILITY_SUMMARY.md detailing schema changes for `upstream_servers` and `call_tool` tools, transitioning to JSON string parameters for improved compatibility.
- Created GEMINI_COMPATIBILITY.md to address known issues with Gemini 2.5 Pro Preview 06-05 and provide updated usage examples and recommendations.
- Refactored mcp.go to support new JSON string parameters while maintaining backward compatibility with legacy object formats.
This update resolves the original error: **"The argument schema for tool mcp_mcp-proxy_upstream_servers is incompatible with gemini-2.5-pro-preview-06-05"**
Gemini 2.5 Pro Preview 06-05 has known compatibility issues with complex MCP tool argument schemas that use nested objects with `AdditionalProperties(true)`.
5
+
6
+
## Solution
7
+
The `upstream_servers` and `call_tool` schemas have been updated to use JSON string parameters instead of complex objects for better compatibility with modern AI models:
8
+
9
+
### Schema Changes
10
+
11
+
**Before (06-05 incompatible):**
12
+
```go
13
+
mcp.WithObject("env",
14
+
mcp.Description("Environment variables for stdio servers"),
15
+
mcp.AdditionalProperties(true),
16
+
),
17
+
mcp.WithObject("headers",
18
+
mcp.Description("HTTP headers for authentication"),
19
+
mcp.AdditionalProperties(true),
20
+
),
21
+
```
22
+
23
+
**After (06-05 compatible):**
24
+
```go
25
+
mcp.WithString("env_json",
26
+
mcp.Description("Environment variables for stdio servers as JSON string (e.g., '{\"API_KEY\": \"value\"}')"),
27
+
),
28
+
mcp.WithString("headers_json",
29
+
mcp.Description("HTTP headers for authentication as JSON string (e.g., '{\"Authorization\": \"Bearer token\"}')"),
30
+
),
31
+
```
32
+
33
+
**call_tool Changes:**
34
+
```go
35
+
// Before (Gemini 2.5/GPT-4.1 incompatible)
36
+
mcp.WithObject("args",
37
+
mcp.Description("Arguments to pass to the tool"),
38
+
mcp.AdditionalProperties(true),
39
+
),
40
+
41
+
// After (Gemini 2.5/GPT-4.1 compatible)
42
+
mcp.WithString("args_json",
43
+
mcp.Description("Arguments to pass to the tool as JSON string"),
mcp.Description("Tool name in format 'server:tool' (e.g., 'github:create_repository'). Get this from retrieve_tools results."),
128
128
),
129
-
mcp.WithObject("args",
130
-
mcp.Description("Arguments to pass to the tool. Refer to the tool's inputSchema from retrieve_tools for required parameters."),
131
-
mcp.AdditionalProperties(true),
129
+
mcp.WithString("args_json",
130
+
mcp.Description("Arguments to pass to the tool as JSON string. Refer to the tool's inputSchema from retrieve_tools for required parameters. Example: '{\"param1\": \"value1\", \"param2\": 123}'"),
0 commit comments