Skip to main content
Glama
RJW34

Weather Edge MCP Server

get_station_observation

Get the latest METAR observation for a specified city from its weather station. Supports NYC, Chicago, Denver, Miami, and LA.

Instructions

Get the latest METAR observation from the settlement station for one city.

Args: city: One of nyc, chicago, denver, miami, la.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cityYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler for get_station_observation - decorates function with @mcp.tool(), calls get_city, fetch_station_observation, and format_station_observation.
    @mcp.tool()
    def get_station_observation(city: str) -> str:
        """Get the latest METAR observation from the settlement station for one city.
    
        Args:
            city: One of nyc, chicago, denver, miami, la.
        """
        cfg = get_city(city)
        return format_station_observation(cfg.key, _run(fetch_station_observation(cfg.key)))
  • Async function that fetches METAR observation data from aviationweather.gov API, parses the JSON response, and returns transformed result with temp in °C and °F, wind speed, station info, and raw METAR text.
    async def fetch_station_observation(city_key: str) -> dict[str, Any]:
        cached = get_cached(f"station_{city_key}")
        if cached:
            return cached
        cfg = CITIES[city_key]
        async with httpx.AsyncClient(timeout=10) as client:
            resp = await client.get(AVIATION_WEATHER_BASE, params={"ids": cfg.metar_station, "format": "json"})
            resp.raise_for_status()
            payload = resp.json()
            if not payload:
                raise RuntimeError(f"No METAR observation for {cfg.metar_station}")
            obs = payload[0]
            result = {
                "city": city_key,
                "station": cfg.station,
                "icao": cfg.metar_station,
                "observed_at": obs.get("obsTime") or obs.get("observationTime") or "",
                "temp_c": obs.get("temp") if obs.get("temp") is not None else obs.get("tempC"),
                "wind_speed_kt": obs.get("wspd") or obs.get("windSpeed"),
                "raw": obs.get("rawOb") or obs.get("rawText") or "",
            }
            result["temp_f"] = round((float(result["temp_c"]) * 9 / 5) + 32, 1) if result["temp_c"] is not None else None
            set_cached(f"station_{city_key}", result)
            return result
  • Formats the station observation data dict into a human-readable string output (station name, ICAO, timestamp, temp °F, wind, raw METAR).
    def format_station_observation(city_key: str, obs: dict[str, Any]) -> str:
        return (
            f"# Station Observation — {CITIES[city_key].label}\n\n"
            f"Station: {obs['station']} ({obs['icao']})\n"
            f"Observed at: {obs['observed_at']}\n"
            f"Temperature: {obs['temp_f']}°F\n"
            f"Wind: {obs['wind_speed_kt']} kt\n"
            f"Raw METAR: {obs['raw']}"
        )
  • CityConfig dataclass defines the schema including metar_station field used to identify the settlement station for observations.
    @dataclass(frozen=True)
    class CityConfig:
        key: str
        label: str
        station: str
        metar_station: str
        nws_office: str
        nws_grid_x: int
        nws_grid_y: int
        kalshi_series: str
        sigma: float
        forecast_bias: float
    
    
    CITIES: dict[str, CityConfig] = {
        "nyc": CityConfig("nyc", "New York City", "Central Park", "KNYC", "OKX", 33, 37, "KXHIGHNY", 3.0, -1.0),
        "chicago": CityConfig("chicago", "Chicago", "Midway", "KMDW", "LOT", 76, 73, "KXHIGHCHI", 3.0, -0.5),
        "denver": CityConfig("denver", "Denver", "Denver", "KDEN", "BOU", 62, 60, "KXHIGHDEN", 4.0, 0.0),
        "miami": CityConfig("miami", "Miami", "MIA Airport", "KMIA", "MFL", 75, 54, "KXHIGHMIA", 3.5, -3.0),
        "la": CityConfig("la", "Los Angeles", "Los Angeles Downtown", "KLAX", "LOX", 154, 44, "HIGHLA", 3.5, 0.0),
    }
  • FastMCP server instantiation with 'weather-edge' name and instructions mentioning get_station_observation tool.
    mcp = FastMCP(
        name="weather-edge",
        instructions=(
            "Weather Edge MCP Server for calibrated Kalshi weather-market intelligence. "
            "Use list_cities for supported markets, get_weather_signals for one city, "
            "get_all_signals for a full scan, get_forecast for raw forecast context, and "
            "get_station_observation for live settlement-station readings."
        ),
    )
Behavior2/5

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

No annotations exist, so the description must carry behavioral disclosure. It mentions the tool provides the latest METAR observation and lists allowed cities, but lacks details on error handling, cache behavior, or output structure. The output schema exists but is not described.

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 very concise with two sentences, including a structured Args section. Every sentence is necessary, though front-loading could be improved by placing the allowed cities list earlier.

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

Completeness4/5

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

For a simple tool with one parameter and an existing output schema, the description is mostly complete. It covers the purpose, parameter, and allowed values. Missing are any notes on return format or potential errors, but these are mitigated by the output schema.

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 meaning by enumerating allowed city values (nyc, chicago, denver, miami, la) which the input schema does not provide (no enum). Since schema coverage is 0%, this partially compensates, but does not explain format or constraints.

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 it retrieves the latest METAR observation for a single city, which distinguishes it from sibling tools like get_all_signals or get_forecast. However, it does not explicitly contrast with these alternatives.

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 lists valid city values but provides no guidance on when to use this tool instead of siblings like get_forecast or get_all_signals. No exclusion criteria or context are given.

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/RJW34/weather-edge-mcp'

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