소스 검색

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

Xiaogang Liao 3 일 전
부모
커밋
1817db7570
1개의 변경된 파일과 2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      cfc-backend/src/main/java/com/etotem/cfc/controller/mcp/McpToolRegistry.java

+ 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;