get_current_weather
Retrieve current weather observations from AMeDAS stations across Japan, including temperature, humidity, pressure, wind, and precipitation data for specific locations or all stations.
Instructions
Get current weather observation data from AMeDAS stations.
Args: station_code: Station code (e.g., '44132' for Tokyo). If not specified, returns data for all stations.
Returns: Weather data including temperature, humidity, pressure, wind, precipitation, etc.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| station_code | No |
Implementation Reference
- jma_data_mcp/server.py:128-150 (handler)The handler function for the 'get_current_weather' tool. It fetches current weather data from AMeDAS stations using fetch_amedas_data, optionally for a specific station code, and formats the response.@mcp.tool() async def get_current_weather( station_code: Optional[str] = None, ) -> dict: """Get current weather observation data from AMeDAS stations. Args: station_code: Station code (e.g., '44132' for Tokyo). If not specified, returns data for all stations. Returns: Weather data including temperature, humidity, pressure, wind, precipitation, etc. """ weather_data = await fetch_amedas_data(station_code) if station_code: station_info = get_station(station_code) if station_info and station_code in weather_data["stations"]: weather_data["station_info"] = station_info weather_data["weather"] = weather_data["stations"][station_code] del weather_data["stations"] return weather_data