Skip to main content
Glama
RJW34

Weather Edge MCP Server

get_all_signals

Scan all supported cities to rank top weather-market signals by combining dual-model forecasts.

Instructions

Run a full scan across all supported cities and rank top weather-market signals.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool handler for 'get_all_signals'. Iterates over all cities, runs compute_signals for each, then formats the results via format_all_signals.
    @mcp.tool()
    def get_all_signals() -> str:
        """Run a full scan across all supported cities and rank top weather-market signals."""
        items = []
        for key, cfg in CITIES.items():
            items.append((cfg.label, _run(compute_signals(key))))
        return format_all_signals(items)
  • The @mcp.tool() decorator registers this function as an MCP tool named 'get_all_signals'.
    @mcp.tool()
    def get_all_signals() -> str:
  • The format_all_signals helper function formats the full scan results into a readable string, sorting signals by net EV across all cities.
    def format_all_signals(items: list[tuple[str, dict[str, Any]]]) -> str:
        summaries: list[tuple[float, str, dict[str, Any]]] = []
        for city_label, data in items:
            for signal in data.get("signals", [])[:5]:
                if signal.get("verdict"):
                    summaries.append((signal["net_ev_cents"], city_label, signal))
        summaries.sort(key=lambda row: row[0], reverse=True)
        lines = ["# Weather Edge — Full Scan", ""]
        for _, city_label, signal in summaries[:15]:
            lines.append(
                f"- {city_label}: [{signal['verdict']}] {signal['bucket']} | market {signal['market_price']}% | edge {signal['edge']:+.1f} pts | EV {signal['net_ev_cents']:+.1f}c"
            )
        if len(lines) == 2:
            lines.append("No positive-EV signals found across supported cities.")
        return "\n".join(lines)
  • The compute_signals helper computes all signals for a single city, fetching NWS forecast and Kalshi markets, then calculating probabilities and edges. Called by get_all_signals for each city.
    async def compute_signals(city_key: str) -> dict[str, Any]:
        cached = get_cached(f"signals_{city_key}")
        if cached:
            return cached
    
        cfg = CITIES[city_key]
        forecast = await fetch_nws_forecast(city_key)
        if not forecast:
            return {"city": city_key, "error": "NWS unavailable", "signals": []}
    
        markets = await fetch_kalshi_markets(city_key)
        signals: list[dict[str, Any]] = []
    
        for market in markets:
            subtitle = market.get("subtitle", market.get("yes_sub_title", ""))
            yes_bid = float(market.get("yes_bid_dollars", 0) or 0)
            yes_ask = float(market.get("yes_ask_dollars", 0) or 0)
            volume = float(market.get("volume_fp", market.get("volume", 0)) or 0)
    
            is_over = "or above" in subtitle.lower() or "greater" in market.get("strike_type", "")
            is_under = "or below" in subtitle.lower()
            low_f = high_f = None
            nums = re.findall(r"(\d+)", subtitle)
            if is_over and nums:
                low_f = int(nums[0])
            elif is_under and nums:
                high_f = int(nums[0])
            elif len(nums) >= 2:
                low_f, high_f = int(nums[0]), int(nums[1])
    
            nws_prob = compute_probability(
                forecast["high_f"],
                low_f,
                high_f,
                is_over,
                is_under,
                sigma=cfg.sigma,
                forecast_bias=cfg.forecast_bias,
            )
            mid_price = (yes_bid + yes_ask) / 2 if yes_ask > 0 else yes_bid
            if mid_price <= 0:
                continue
    
            edge = nws_prob - mid_price
            fee = 0.07 * mid_price * (1 - mid_price)
            net_ev = nws_prob * (1 - yes_ask) - (1 - nws_prob) * yes_ask - fee if yes_ask > 0 else 0
            verdict = "STRONG" if net_ev > 0.05 else ("GOOD" if net_ev > 0.02 else ("MARGINAL" if net_ev > 0 else ""))
    
            signals.append(
                {
                    "ticker": market.get("ticker", ""),
                    "bucket": subtitle,
                    "date": forecast["date"],
                    "nws_high": forecast["high_f"],
                    "nws_prob": round(nws_prob * 100, 1),
                    "market_price": round(mid_price * 100, 1),
                    "edge": round(edge * 100, 1),
                    "net_ev_cents": round(net_ev * 100, 1),
                    "volume": int(volume),
                    "yes_bid": yes_bid,
                    "yes_ask": yes_ask,
                    "verdict": verdict,
                }
            )
    
        signals.sort(key=lambda signal: signal["net_ev_cents"], reverse=True)
        result = {
            "city": city_key,
            "city_label": cfg.label,
            "station": cfg.station,
            "forecast": forecast,
            "signals": signals,
            "generated_at": datetime.now(timezone.utc).isoformat(),
        }
        set_cached(f"signals_{city_key}", result)
        return result
  • The CityConfig dataclass defines the input configuration schema used by get_all_signals to iterate over cities.
    @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
Behavior2/5

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

No annotations are provided, so the description carries full responsibility for behavioral disclosure. It describes the action as a 'full scan' but does not mention any side effects, potential rate limits, authorization requirements, or whether the scan is resource-intensive. The agent has no information about safety or performance implications, which is a significant gap for a potentially expensive operation.

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

Conciseness5/5

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

The description consists of a single sentence that clearly and efficiently conveys the tool's purpose. Every word is meaningful, with no redundancy or filler. It is appropriately sized for its simplicity.

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?

Given the tool has no parameters and an output schema exists (though not shown in this evaluation), the description is largely complete. It states the tool scans all cities and ranks signals. However, it could benefit from noting that this is a broad, potentially expensive operation, and that the output schema details the results. Overall adequate but slightly lacking in operational context.

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 no parameters, and schema coverage is 100% (empty schema). The description adds no parameter-level information because none is needed. With zero parameters, the baseline for this dimension is 4, and the description does not detract from it.

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

Purpose5/5

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

The description clearly states it runs a full scan across all supported cities and ranks top weather-market signals. It specifies the verb ('run a full scan'), resource ('signals'), and scope ('all supported cities'), distinguishing it from siblings like get_weather_signals which likely filter by city or other criteria.

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

Usage Guidelines4/5

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

The description implicitly indicates when to use this tool: for a comprehensive scan across all cities. However, it does not explicitly state when not to use it or mention alternatives such as get_weather_signals for more targeted queries. The context of sibling tools provides some guidance, but the description lacks explicit exclusions or prerequisites.

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