get_station_info
Retrieve detailed AMeDAS station information including name, location, and type using station codes from the Japan Meteorological Agency's network.
Instructions
Get AMeDAS station information by station code.
Args: code: Station code (e.g., '44132' for Tokyo)
Returns: Station information including name, location, and type
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes |
Implementation Reference
- jma_data_mcp/server.py:28-41 (handler)The main handler function for the 'get_station_info' tool. It is registered via @mcp.tool() decorator and implements the core logic by calling the get_station helper, handling the case where the station is not found.@mcp.tool() async def get_station_info(code: str) -> dict: """Get AMeDAS station information by station code. Args: code: Station code (e.g., '44132' for Tokyo) Returns: Station information including name, location, and type """ station = get_station(code) if station: return station return {"error": f"Station with code '{code}' not found."}
- jma_data_mcp/stations.py:22-26 (helper)Supporting helper function that loads the stations data cache and retrieves the station dictionary by its code.def get_station(code: str) -> Optional[dict]: """Get station by code.""" stations = load_stations() return stations.get(code)