get_station_info
Retrieve detailed station information including name, location, and type by providing a station code for Japan Meteorological Agency weather stations.
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 async handler function for the 'get_station_info' MCP tool, registered via @mcp.tool() decorator. It fetches station info by code using the get_station helper or returns an error if 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)Core helper function that loads AMeDAS stations data from JSON file (cached) and retrieves the specific station dictionary by its code.def get_station(code: str) -> Optional[dict]: """Get station by code.""" stations = load_stations() return stations.get(code)