Prechádzať zdrojové kódy

fix(mcp): McpToolRegistry toolSchema 参数 name 缺失导致 properties 为空 [skip ci]

Xiaogang Liao 3 dní pred
rodič
commit
1817db7570

+ 2 - 0
cfc-backend/src/main/java/com/etotem/cfc/controller/mcp/McpToolRegistry.java

@@ -421,6 +421,7 @@ public class McpToolRegistry {
 
     private static Map<String, Object> required(String name, String type, String description) {
         Map<String, Object> p = new LinkedHashMap<>();
+        p.put("name", name);
         p.put("type", type);
         p.put("description", description);
         return p;
@@ -428,6 +429,7 @@ public class McpToolRegistry {
 
     private static Map<String, Object> optional(String name, String type, String description) {
         Map<String, Object> p = new LinkedHashMap<>();
+        p.put("name", name);
         p.put("type", type);
         p.put("description", description);
         return p;