|
6 | 6 |
|
7 | 7 | package modelengine.fel.tool.mcp.server; |
8 | 8 |
|
| 9 | +import static modelengine.fitframework.inspection.Validation.notNull; |
9 | 10 | import io.modelcontextprotocol.server.McpServerFeatures; |
10 | 11 | import io.modelcontextprotocol.spec.McpSchema; |
11 | 12 | import modelengine.fel.tool.mcp.entity.ServerSchema; |
|
26 | 27 | import static modelengine.fel.tool.info.schema.PluginSchema.TYPE; |
27 | 28 | import static modelengine.fel.tool.info.schema.ToolsSchema.PROPERTIES; |
28 | 29 | import static modelengine.fel.tool.info.schema.ToolsSchema.REQUIRED; |
29 | | -import static modelengine.fitframework.inspection.Validation.notNull; |
30 | 30 |
|
31 | 31 | /** |
32 | 32 | * Mcp Server implementing interface {@link McpServer}, {@link ToolChangedObserver} |
33 | 33 | * with MCP Server Bean {@link McpSyncServer}. |
34 | 34 | * |
35 | | - * @author 黄可欣 |
36 | | - * @since 2025-09-30 |
| 35 | + * @author 季聿阶 |
| 36 | + * @since 2025-05-15 |
37 | 37 | */ |
38 | 38 | @Component |
39 | 39 | public class DefaultMcpServer implements McpServer, ToolChangedObserver { |
40 | 40 | private static final Logger log = Logger.get(DefaultMcpServer.class); |
41 | 41 | private final McpSyncServer mcpSyncServer; |
42 | 42 |
|
43 | | - private final Map<String, Tool> tools = new ConcurrentHashMap<>(); |
44 | 43 | private final ToolExecuteService toolExecuteService; |
| 44 | + private final Map<String, Tool> tools = new ConcurrentHashMap<>(); |
45 | 45 | private final List<ToolsChangedObserver> toolsChangedObservers = new ArrayList<>(); |
46 | 46 |
|
47 | 47 | /** |
@@ -119,7 +119,7 @@ public void onToolAdded(String name, String description, Map<String, Object> par |
119 | 119 | tool.setDescription(description); |
120 | 120 | tool.setInputSchema(parameters); |
121 | 121 | this.tools.put(name, tool); |
122 | | - log.info("Tool added to MCP server. [toolName={}, description={}, schema={}]", name, description, inputSchema); |
| 122 | + log.info("Tool added to MCP server. [toolName={}, description={}, schema={}]", name, description, parameters); |
123 | 123 | this.toolsChangedObservers.forEach(ToolsChangedObserver::onToolsChanged); |
124 | 124 | } |
125 | 125 |
|
|
0 commit comments