Skip to main content
Glama

get_forecast

Retrieve weather forecasts for Japanese prefectures using Japan Meteorological Agency data to plan activities and prepare for conditions.

Instructions

Get weather forecast for a prefecture.

Args: prefecture: Prefecture name in English (e.g., 'tokyo', 'osaka', 'hokkaido_sapporo')

Returns: Weather forecast data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
prefectureYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The get_forecast tool handler function, registered via @mcp.tool(). It validates the prefecture against AREA_CODES, fetches the forecast data using fetch_forecast, and returns formatted results or an error.
    @mcp.tool()
    async def get_forecast(prefecture: str) -> dict:
        """Get weather forecast for a prefecture.
    
        Args:
            prefecture: Prefecture name in English (e.g., 'tokyo', 'osaka', 'hokkaido_sapporo')
    
        Returns:
            Weather forecast data
        """
        area_code = AREA_CODES.get(prefecture)
        if not area_code:
            return {
                "error": f"Unknown prefecture: {prefecture}",
                "available": list(AREA_CODES.keys()),
            }
    
        forecast_data = await fetch_forecast(area_code)
        return {
            "prefecture": prefecture,
            "area_code": area_code,
            "forecast": forecast_data,
        }
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 of behavioral disclosure. It states the tool 'Get[s] weather forecast' but doesn't mention any behavioral traits such as rate limits, authentication needs, data freshness, or error handling. For a tool with no annotation coverage, this leaves significant gaps in understanding how it behaves.

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 appropriately sized and front-loaded, starting with the core purpose. The 'Args' and 'Returns' sections are structured clearly, though the 'Returns' section is vague ('Weather forecast data'). There's minimal waste, but the lack of sibling differentiation and behavioral details means not every sentence earns its place fully.

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 low complexity (1 parameter, no nested objects) and the presence of an output schema, the description is somewhat complete. It covers the basic purpose and parameter semantics, but with no annotations and siblings like 'get_current_weather,' it misses key contextual elements such as when to use this tool and behavioral traits, making it adequate but with clear gaps.

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

Parameters3/5

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

The description adds some meaning beyond the input schema by specifying that 'prefecture' should be a 'Prefecture name in English' with examples like 'tokyo', 'osaka', 'hokkaido_sapporo'. However, with 0% schema description coverage and only one parameter, this provides basic clarification but doesn't fully compensate for the lack of schema details, such as format constraints or validation rules.

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: 'Get weather forecast for a prefecture.' This specifies the verb ('Get'), resource ('weather forecast'), and scope ('for a prefecture'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'get_current_weather' or 'get_weather_by_location,' which prevents a perfect score.

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. With siblings like 'get_current_weather' and 'get_weather_by_location,' there's no indication of whether this tool is for future forecasts, specific geographic areas, or other contexts. The lack of any usage context or exclusions leaves the agent guessing.

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