search_stations
Find AMeDAS weather stations by name using Japanese, Kana, or English queries to access JMA weather data.
Instructions
Search AMeDAS stations by name (Japanese, Kana, or English).
Args: name: Station name to search
Returns: List of matching stations
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |
Implementation Reference
- jma_data_mcp/server.py:44-56 (handler)MCP tool handler for 'search_stations'. Decorated with @mcp.tool() for registration. Executes search using helper function and returns formatted results.@mcp.tool() async def search_stations(name: str) -> dict: """Search AMeDAS stations by name (Japanese, Kana, or English). Args: name: Station name to search Returns: List of matching stations """ stations = search_stations_by_name(name) return {"count": len(stations), "stations": stations}
- jma_data_mcp/stations.py:28-41 (helper)Core helper function implementing the station name search logic with substring matching on Japanese, Kana, and English names.def search_stations_by_name(name: str) -> list[dict]: """Search stations by name (Japanese, Kana, or English).""" stations = load_stations() results = [] name_lower = name.lower() for station in stations.values(): if (name in station["name"]["ja"] or name in station["name"]["kana"] or name_lower in station["name"]["en"].lower()): results.append(station) return results
- jma_data_mcp/server.py:44-44 (registration)FastMCP decorator registering the 'search_stations' function as a tool.@mcp.tool()