Skip to main content
Glama

get_station_info

Retrieve detailed station information including name, location, and type by providing a station code for Japan Meteorological Agency weather stations.

Instructions

Get AMeDAS station information by station code.

Args: code: Station code (e.g., '44132' for Tokyo)

Returns: Station information including name, location, and type

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes

Implementation Reference

  • The async handler function for the 'get_station_info' MCP tool, registered via @mcp.tool() decorator. It fetches station info by code using the get_station helper or returns an error if not found.
    @mcp.tool()
    async def get_station_info(code: str) -> dict:
        """Get AMeDAS station information by station code.
    
        Args:
            code: Station code (e.g., '44132' for Tokyo)
    
        Returns:
            Station information including name, location, and type
        """
        station = get_station(code)
        if station:
            return station
        return {"error": f"Station with code '{code}' not found."}
  • Core helper function that loads AMeDAS stations data from JSON file (cached) and retrieves the specific station dictionary by its code.
    def get_station(code: str) -> Optional[dict]:
        """Get station by code."""
        stations = load_stations()
        return stations.get(code)

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