get_nearest_station
Locate the closest KNMI weather station to specified coordinates for accessing Netherlands weather data.
Instructions
Find the nearest KNMI weather station to given coordinates
Args:
latitude: Latitude in degrees
longitude: Longitude in degrees
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| latitude | Yes | ||
| longitude | Yes |
Implementation Reference
- src/knmi_weather_mcp/server.py:145-157 (handler)The main handler function for the 'get_nearest_station' tool. It refreshes the station list and delegates to StationManager.find_nearest_station to find and return the nearest WeatherStation.@mcp.tool() async def get_nearest_station(latitude: float, longitude: float, ctx: Context) -> WeatherStation: """ Find the nearest KNMI weather station to given coordinates Args: latitude: Latitude in degrees longitude: Longitude in degrees """ await station_manager.refresh_stations(ctx) coords = Coordinates(latitude=latitude, longitude=longitude) return station_manager.find_nearest_station(coords)
- src/knmi_weather_mcp/server.py:145-145 (registration)The @mcp.tool() decorator registers the get_nearest_station function as an MCP tool.@mcp.tool()