list_stations
Retrieve paginated lists of AMeDAS weather stations across Japan to access meteorological data from the Japan Meteorological Agency.
Instructions
List all AMeDAS stations (1286 stations) with pagination.
Args: limit: Maximum number of stations to return (default: 100) offset: Number of stations to skip (default: 0)
Returns: Paginated list of stations
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| offset | No |
Implementation Reference
- jma_data_mcp/server.py:102-124 (handler)The main asynchronous handler function for the 'list_stations' MCP tool, decorated with @mcp.tool() for automatic registration. It fetches all stations via get_all_stations() helper and implements pagination based on limit and offset parameters.@mcp.tool() async def list_stations( limit: int = 100, offset: int = 0, ) -> dict: """List all AMeDAS stations (1286 stations) with pagination. Args: limit: Maximum number of stations to return (default: 100) offset: Number of stations to skip (default: 0) Returns: Paginated list of stations """ all_stations = get_all_stations() paginated = all_stations[offset : offset + limit] return { "total": len(all_stations), "offset": offset, "limit": limit, "count": len(paginated), "stations": paginated, }
- jma_data_mcp/stations.py:88-92 (helper)Supporting helper function that loads the complete dictionary of AMeDAS stations from the local JSON file (via load_stations()) and returns them as a list, used by the list_stations tool handler.def get_all_stations() -> list[dict]: """Get all stations.""" stations = load_stations() return list(stations.values())