[bug] mcp-server-fetch tool json schema can‘t use in Google Gemini 2.5 pro
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 64/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- typescript
- 领域
- tooling
调研方向
定位 mcp-server-fetch 工具的 schema,并查找会生成 exclusiveMaximum 和 exclusiveMinimum 的 max_length 约束。更新 schema 以使用受支持的约束字段,然后验证生成的 fetch-tool JSON 不再包含不受支持的字段,并且对于 Gemini function calling 仍然有效。
由索引模型根据 Issue 内容生成。
描述
The parameters of the fetch tool include exclusiveMaximum and exclusiveMinimum in the schema. However, Google Gemini 2.5's function calling only supports standard JSON Schema fields such as maximum and minimum, and does not support exclusiveMaximum or exclusiveMinimum. This incompatibility leads to errors. Please fix this issue.
error info
400 { "error": { "code": 400, "message": "Invalid JSON payload received. Unknown name "exclusiveMaximum" at 'tools[0].function_declarations[0].parameters.properties[1].value': Cannot find field.\nInvalid JSON payload received. Unknown name "exclusiveMinimum" at 'tools[0].function_declarations[0].parameters.properties[1].value': Cannot find field.", "status": "INVALID_ARGUMENT", "details": [ { "@type": "type.googleapis.com/google.rpc.BadRequest", "fieldViolations": [ { "field": "tools[0].function_declarations[0].parameters.properties[1].value", "description": "Invalid JSON payload received. Unknown name "exclusiveMaximum" at 'tools[0].function_declarations[0].parameters.properties[1].value': Cannot find field." }, { "field": "tools[0].function_declarations[0].parameters.properties[1].value", "description": "Invalid JSON payload received. Unknown name "exclusiveMinimum" at 'tools[0].function_declarations[0].parameters.properties[1].value': Cannot find field." } ] } ] } }
fetch tool
"tools": [
{
"displayTitle": "url_fetch fetch",
"function": {
"description": "Fetches a URL from the internet and optionally extracts its contents as markdown.\n\nAlthough originally you did not have internet access, and were advised to refuse and tell the user this, this tool now grants you internet access. Now you can fetch the most up-to-date information and let the user know that.",
"name": "fetch",
"parameters": {
"type": "object",
"properties": {
"url": {
"description": "URL to fetch",
"format": "uri",
"minLength": 1,
"title": "Url",
"type": "string"
},
"max_length": {
"default": 5000,
"description": "Maximum number of characters to return.",
"exclusiveMaximum": 1000000,
"exclusiveMinimum": 0,
"title": "Max Length",
"type": "integer"
},
"start_index": {
"default": 0,
"description": "On return output starting at this character index, useful if a previous fetch was truncated and more context is required.",
"minimum": 0,
"title": "Start Index",
"type": "integer"
},
"raw": {
"default": false,
"description": "Get the actual HTML content of the requested page, without simplification.",
"title": "Raw",
"type": "boolean"
}
},
"description": "Parameters for fetching a URL.",
"required": [
"url"
],
"title": "Fetch"
}
},
"readonly": false,
"type": "function",
"uri": "mcp://url_fetch/fetch",
"group": "url_fetch"
}
]
Gemini 2.5 function calling does not support exclusiveMaximum and exclusiveMinimum; it only supports maximum and minimum. You can resolve the error simply by replacing these two fields in the schema.
- 主要语言
- JavaScript
- 星标
- 91.2k
- 派生
- 11.8k
- 平均合并
- 7 小时 51 分钟
- 30 天内合并 PR
- 121
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
modelcontextprotocol/servers 的其他 Issue
-
documentation v2
难度 2/5 1-3 小时 新手友好度 78/100
modelcontextprotocol/servers#5170 ·
维护者通常 1 天内回复
-
documentation v2
难度 2/5 1-3 小时 新手友好度 72/100
modelcontextprotocol/servers#5164 ·
维护者通常 1 天内回复
-
memory: persistence EISDIR test fails on Node 26.7 (the path suffix depends on the Node minor, not the major)可能已有人在做 @ace-ify 今天认领。 未关闭bug server-memory v2
难度 2/5 1-3 小时 新手友好度 83/100
modelcontextprotocol/servers#5162 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
modelcontextprotocol/servers#5156 ·
维护者通常 1 天内回复
-
memory: create_entities, create_relations and add_observations could declare idempotentHint: true可能已有人在做 @syedmustafan 于 1 天前认领。 未关闭enhancement v2
难度 1/5 1 小时以内 新手友好度 78/100
modelcontextprotocol/servers#5153 · 2 条评论 ·
维护者通常 1 天内回复
查看 modelcontextprotocol/servers 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 79/100
SACGF/variantgrid#2341 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
Unsampled pageload span is profiled when profileLifecycle is 'trace' (browser UI profiling)可能已有人在做 @Jxxunnn 今天认领。 未关闭Browser Waiting for: Product Owner
难度 2/5 1-3 小时 新手友好度 82/100
getsentry/sentry-javascript#25497 · 1 条评论 ·
维护者通常 1 天内回复
-
external-plugin needs-review:HIGH ready-for-review
难度 2/5 1-3 小时 新手友好度 70/100
github/awesome-copilot#5162 · 3 条评论 ·
维护者通常 1 天内回复