list_prefectures
Retrieve prefecture codes for accessing Japan Meteorological Agency weather forecasts, enabling users to identify regions for weather data queries.
Instructions
List all available prefecture codes for weather forecast.
Returns: Dictionary of prefecture names and their codes
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- jma_data_mcp/server.py:208-216 (handler)Handler function for the 'list_prefectures' tool, registered via @mcp.tool() decorator. Simply returns the AREA_CODES dictionary wrapped in a 'prefectures' key.@mcp.tool() async def list_prefectures() -> dict: """List all available prefecture codes for weather forecast. Returns: Dictionary of prefecture names and their codes """ return {"prefectures": AREA_CODES}
- jma_data_mcp/weather.py:438-487 (helper)Supporting constant AREA_CODES: dictionary mapping English prefecture names to JMA forecast area codes, which provides the data returned by the list_prefectures tool.# Area codes for major prefectures AREA_CODES = { "hokkaido_sapporo": "016000", "aomori": "020000", "iwate": "030000", "miyagi": "040000", "akita": "050000", "yamagata": "060000", "fukushima": "070000", "ibaraki": "080000", "tochigi": "090000", "gunma": "100000", "saitama": "110000", "chiba": "120000", "tokyo": "130000", "kanagawa": "140000", "niigata": "150000", "toyama": "160000", "ishikawa": "170000", "fukui": "180000", "yamanashi": "190000", "nagano": "200000", "gifu": "210000", "shizuoka": "220000", "aichi": "230000", "mie": "240000", "shiga": "250000", "kyoto": "260000", "osaka": "270000", "hyogo": "280000", "nara": "290000", "wakayama": "300000", "tottori": "310000", "shimane": "320000", "okayama": "330000", "hiroshima": "340000", "yamaguchi": "350000", "tokushima": "360000", "kagawa": "370000", "ehime": "380000", "kochi": "390000", "fukuoka": "400000", "saga": "410000", "nagasaki": "420000", "kumamoto": "430000", "oita": "440000", "miyazaki": "450000", "kagoshima": "460000", "okinawa": "470000", }