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

Output 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()
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states the tool returns a dictionary of names and codes, which is basic output information. However, it doesn't disclose behavioral traits such as whether it's a read-only operation, potential rate limits, data freshness, or error conditions. For a tool with no annotations, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and front-loaded, with the main purpose stated clearly in the first sentence. The second sentence adds value by specifying the return format. There's no wasted text, making it efficient, though it could be slightly more structured for better readability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, output schema exists), the description is somewhat complete but lacks depth. It explains what the tool does and the return format, but without annotations or usage guidelines, it doesn't fully address behavioral aspects or integration with sibling tools. The output schema reduces the need for return value details, but overall completeness is minimal viable.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100%, so there are no parameters to document. The description doesn't need to add parameter semantics, but it does mention the return format (dictionary of names and codes), which aligns with the output schema. Baseline for 0 parameters is 4, as it appropriately handles the lack of inputs.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose as 'List all available prefecture codes for weather forecast,' which is a specific verb (list) and resource (prefecture codes). It distinguishes itself from siblings by focusing on administrative divisions rather than weather data or stations. However, it doesn't explicitly differentiate from 'list_stations' or other list tools, keeping it at a 4.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context for selecting prefectures, or how it relates to sibling tools like 'get_weather_by_location' or 'list_stations.' This lack of usage context leaves the agent without clear direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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