From 9bfbcb4c9024a5e3638f273f4f06ec5b34b5f4e8 Mon Sep 17 00:00:00 2001 From: Christian Tzolov Date: Thu, 27 Mar 2025 01:32:16 +0100 Subject: [PATCH] print tools properties Signed-off-by: Christian Tzolov --- .../org/springframework/ai/mcp/sample/client/SampleClient.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/model-context-protocol/weather/starter-webmvc-server/src/test/java/org/springframework/ai/mcp/sample/client/SampleClient.java b/model-context-protocol/weather/starter-webmvc-server/src/test/java/org/springframework/ai/mcp/sample/client/SampleClient.java index a02400c..11afef5 100644 --- a/model-context-protocol/weather/starter-webmvc-server/src/test/java/org/springframework/ai/mcp/sample/client/SampleClient.java +++ b/model-context-protocol/weather/starter-webmvc-server/src/test/java/org/springframework/ai/mcp/sample/client/SampleClient.java @@ -46,6 +46,9 @@ public class SampleClient { // List and demonstrate tools ListToolsResult toolsList = client.listTools(); System.out.println("Available Tools = " + toolsList); + toolsList.tools().stream().forEach(tool -> { + System.out.println("Tool: " + tool.name() + ", description: " + tool.description() + ", schema: " + tool.inputSchema()); + }); CallToolResult weatherForcastResult = client.callTool(new CallToolRequest("getWeatherForecastByLocation", Map.of("latitude", "47.6062", "longitude", "-122.3321")));