Skip to main content
Glama

list_prefectures

Retrieve prefecture codes for accessing Japan Meteorological Agency weather forecasts. Use this tool to identify available regions before requesting specific weather data.

Instructions

List all available prefecture codes for weather forecast.

Returns: Dictionary of prefecture names and their codes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'list_prefectures' tool, registered via @mcp.tool() decorator. It simply returns a dictionary containing the AREA_CODES mapping of prefecture names to their JMA area codes.
    @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}
  • Constant dictionary AREA_CODES that maps English prefecture names to JMA forecast area codes, directly used and 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", }
  • The @mcp.tool() decorator registers the list_prefectures function as an MCP tool.
    @mcp.tool()

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/koizumikento/jma-data-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server