Skip to content

Commit 8897ba6

Browse files
committed
minor mcp fixes
Signed-off-by: Christian Tzolov <[email protected]>
1 parent cbf9561 commit 8897ba6

File tree

1 file changed

+5
-2
lines changed
  • model-context-protocol/dynamic-tool-update/server/src/main/java/org/springframework/ai/mcp/sample/server

1 file changed

+5
-2
lines changed

model-context-protocol/dynamic-tool-update/server/src/main/java/org/springframework/ai/mcp/sample/server/ServerApplication.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public ToolCallbackProvider weatherTools(WeatherService weatherService) {
4343
}
4444

4545
@Bean
46-
public CommandLineRunner predefinedQuestions(McpSyncServer mcpSyncServer) {
46+
public CommandLineRunner commandRunner(McpSyncServer mcpSyncServer) {
4747

4848
return args -> {
4949

@@ -54,7 +54,10 @@ public CommandLineRunner predefinedQuestions(McpSyncServer mcpSyncServer) {
5454
List<SyncToolSpecification> newTools = McpToolUtils
5555
.toSyncToolSpecifications(ToolCallbacks.from(new MathTools()));
5656

57-
mcpSyncServer.addTool(newTools.iterator().next());
57+
for (SyncToolSpecification newTool : newTools) {
58+
logger.info("Add new tool: " + newTool);
59+
mcpSyncServer.addTool(newTool);
60+
}
5861

5962
logger.info("Tools updated: ");
6063
};

0 commit comments

Comments
 (0)