Skip to main content
Glama
acxelerator

mcp-tenki

by acxelerator

get_forecast

Retrieve weather forecasts for Japanese prefectures to plan activities and prepare for conditions.

Instructions

Get forecast for a location in Japan

Args:
    prefecture: Name of the prefecture of Japan (in English alphabets, e.g.) "Hokkaido", "Tokyo", "Osaka", etc.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
prefectureYes

Implementation Reference

  • The get_forecast tool handler implementation which fetches weather data from the tsukumijima API.
    @mcp.tool()
    async def get_forecast(prefecture: str) -> str:
        """
        Get forecast for a location in Japan
    
        Args:
            prefecture: Name of the prefecture of Japan (in English alphabets, e.g.) "Hokkaido", "Tokyo", "Osaka", etc.)
        """
        location = convert_pref_to_id(prefecture=prefecture)
        if location is None:
            return "Unable to locate"
        url = f"https://weather.tsukumijima.net/api/forecast?city={location.id_}"
        res = await make_nws_request(url=url)
    
        if not res:
            return "Unable to fetch forecast data for this location."
        forecasts = [WeatherForecast(**f) for f in res["forecasts"]]
        return "\n------\n".join([f.format_forecast() for f in forecasts])
    
    
    def main():
        mcp.run(transport="stdio")
    
    
    if __name__ == "__main__":
        main()
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/acxelerator/mcp-tenki'

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