diff --git a/model-context-protocol/weather/starter-stdio-server/src/main/java/org/springframework/ai/mcp/sample/server/WeatherService.java b/model-context-protocol/weather/starter-stdio-server/src/main/java/org/springframework/ai/mcp/sample/server/WeatherService.java index 5966ea1..2c08e0b 100644 --- a/model-context-protocol/weather/starter-stdio-server/src/main/java/org/springframework/ai/mcp/sample/server/WeatherService.java +++ b/model-context-protocol/weather/starter-stdio-server/src/main/java/org/springframework/ai/mcp/sample/server/WeatherService.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import org.springframework.ai.tool.annotation.Tool; +import org.springframework.ai.tool.annotation.ToolParam; import org.springframework.stereotype.Service; import org.springframework.web.client.RestClient; import org.springframework.web.client.RestClientException; @@ -120,7 +121,7 @@ public class WeatherService { * @throws RestClientException if the request fails */ @Tool(description = "Get weather alerts for a US state. Input is Two-letter US state code (e.g. CA, NY)") - public String getAlerts(String state) { + public String getAlerts(@ToolParam( description = "Two-letter US state code (e.g. CA, NY") String state) { Alert alert = restClient.get().uri("/alerts/active/area/{state}", state).retrieve().body(Alert.class); return alert.features() diff --git a/model-context-protocol/weather/starter-stdio-server/src/main/resources/application.properties b/model-context-protocol/weather/starter-stdio-server/src/main/resources/application.properties index eb07a22..db1e149 100644 --- a/model-context-protocol/weather/starter-stdio-server/src/main/resources/application.properties +++ b/model-context-protocol/weather/starter-stdio-server/src/main/resources/application.properties @@ -5,8 +5,6 @@ spring.main.web-application-type=none spring.main.banner-mode=off logging.pattern.console= -spring.ai.mcp.server.enabled=true - spring.ai.mcp.server.name=my-weather-server spring.ai.mcp.server.version=0.0.1