fix: relax MCP tool JSON Schema Zod validation to handle non-standard types (#6455)

* fix: relax MCP tool JSON Schema Zod validation to accept any type values

MCP servers may return JSON Schema with type values outside the
standard 6 types. Use z.any() for type and items fields to avoid
500 errors on /api/core/app/mcpTools/getTools.

- Remove SchemaInputValueTypeSchema enum and SchemaInputValueType
- Remove unnecessary .passthrough()
- Use plain string type for function parameters

Fixes #6451

* fix: mcp adapt

---------

Co-authored-by: c121914yu <yucongcong_test@163.com>
This commit is contained in:
Archer
2026-02-24 13:48:31 +08:00
committed by GitHub
parent a2250b3a44
commit be9317f601
6 changed files with 56 additions and 22 deletions

View File

@@ -121,6 +121,7 @@ description: FastGPT 文档目录
- [/docs/upgrading/4-14/41451](/docs/upgrading/4-14/41451)
- [/docs/upgrading/4-14/4146](/docs/upgrading/4-14/4146)
- [/docs/upgrading/4-14/4147](/docs/upgrading/4-14/4147)
- [/docs/upgrading/4-14/4148](/docs/upgrading/4-14/4148)
- [/docs/upgrading/4-8/40](/docs/upgrading/4-8/40)
- [/docs/upgrading/4-8/41](/docs/upgrading/4-8/41)
- [/docs/upgrading/4-8/42](/docs/upgrading/4-8/42)

View File

@@ -0,0 +1,18 @@
---
title: 'V4.14.8(进行中)'
description: 'FastGPT V4.14.8 更新说明'
---
## 🚀 新增内容
## ⚙️ 优化
1. 兼容 MCP 中 JSON Schema type 类型不在枚举类型里。
## 🐛 修复
1. 新 SDK 兼容:连续调用同一个 MCP 服务时,多次连接导致报错。

View File

@@ -1,5 +1,5 @@
{
"title": "4.14.x",
"description": "",
"pages": ["4147", "4146", "41451", "4145", "4144", "4143", "4142", "4141", "4140"]
"pages": ["4148", "4147", "4146", "41451", "4145", "4144", "4143", "4142", "4141", "4140"]
}

View File

@@ -205,4 +205,4 @@
"document/content/docs/use-cases/external-integration/openapi.mdx": "2026-02-12T18:45:30+08:00",
"document/content/docs/use-cases/external-integration/wecom.mdx": "2025-12-10T20:07:05+08:00",
"document/content/docs/use-cases/index.mdx": "2025-07-24T14:23:04+08:00"
}
}