Skip to content

KB / mcp

MCP tool: analyze_signals

Last verified

analyze_signals is the platform’s multi-aspect signal inspector. One MCP tool, 15 aspects, each routing to a typed JSON endpoint on the backend. Call this when market_pulse isn’t enough and you need structured data on a specific dimension — the breakdown of the health score, the per-category alignment grid, the cascade-stage state, historical analogues, or a per-metric sparkline.

The tool is a thin dispatcher (mcp/mcp_server/tools/public.py:analyze_signals). Every aspect maps to one backend route via the _ASPECT_MAP table. The mapping is the contract.

Signature

analyze_signals(
  aspect: str,                  # one of the 15 aspects below
  days: int | None = None,      # used by: history, regime_log
  days_back: int | None = None, # used by: diff
  metrics: str | None = None,   # used by: sparklines (comma-separated)
  period: str | None = None,    # used by: sparklines (e.g. "30d")
) -> str                        # JSON-serialised dict | list

Optional params are silently dropped for aspects that don’t consume them — the dispatcher only forwards the params declared in _ASPECT_MAP. Unknown aspects raise ValueError("Unknown aspect '<x>'. Valid: ...") before the round-trip.

Aspects

AspectBackend routeWhat it returns
score_breakdownGET /api/v1/signals/score/breakdownPer-component score detail with raw inputs, bands, weights, 5-day history, regime-override resolution
scoreGET /api/v1/signals/scoreComposite 0–100 health score + component weights
historyGET /api/v1/signals/historyDaily signal-row history (param: days)
regime_logGET /api/v1/signals/regime-logHistorical regime transitions with drivers + score context (param: days)
alignmentGET /api/v1/signals/alignmentSignal-vs-price alignment grid: 11 (or 12 when flag-gated news_sentiment is on) categories’ implications vs SPY direction, with severity, intensity, velocity, freshness
fragilityGET /api/v1/signals/fragilityDistance to nearest regime transition — how close any signal is to flipping its classification
cascadeGET /api/v1/signals/cascade12-stage transmission-stress pipeline (Volatility Spike → Score Collapse), with stage 13 as the meta “Full Cascade” trigger when ≥10 of the 12 are active
base_ratesGET /api/v1/signals/base-ratesHistorical analogue matcher — forward 1d/3d/5d SPY return distributions for similar setups
diffGET /api/v1/signals/diffCompact diff vs a prior snapshot, significant changes only (param: days_back)
velocityGET /api/v1/signals/velocityHealth score rate of change — momentum before the score itself moves
sectorsGET /api/v1/signals/sectorsPer-GICS-sector breadth breakdown
correlationsGET /api/v1/signals/correlationsRolling 20d inter-market correlations (SPY/VIX, SPY/DXY, SPY/TNX, SPY/Oil) with per-pair classification
gammaGET /api/v1/signals/gammaDealer-gamma hedging levels — call/put walls (price magnets)
fedwatchGET /api/v1/signals/fedwatchFed funds rate + cut/hike probabilities
sparklinesGET /api/v1/signals/sparklinesPer-metric time series (params: metrics, period)

Returns

Shape varies by aspect. Every response carries the platform’s standard generated_at (ET ISO 8601 + offset, Law 1) and a schema_version where applicable. Two representative shapes:

aspect="score"

{
  "score": 68,
  "max": 100,
  "regime": "RISK-ON",
  "component_count": 18,
  "weights_active_regime": { "dix": 8, "gex": 6, "hy_oas": 7, "breadth_50d": 7, ... },
  "schema_version": "2026.04.3",
  "generated_at": "2026-05-26T10:14:33-04:00"
}

aspect="alignment"

{
  "schema_version": "2026.05.1",
  "spy_direction": "BULLISH",
  "baseline": "3d",
  "severity": "STRONG_ALIGNMENT",
  "aligned_count": 7,
  "divergent_count": 2,
  "weighted_alignment_pct": 71.4,
  "categories": {
    "dark_pool": { "implication": "BULLISH", "value": 0.46, "reason": "DIX 0.46 (elevated)", "legs": [...], "freshness": {...} },
    "gamma":     { "implication": "BULLISH", ... },
    "credit":    { "implication": "NEUTRAL", ... },
    ...
  },
  "generated_at": "2026-05-26T10:14:33-04:00"
}

Refer to the matching /api/v1/signals/<aspect> KB article (kb/api/get-signals-*) for the per-aspect shape contract.

Behaviour

Examples

Regime fragility

Operator: "How close are we to a regime flip?"
Agent: analyze_signals(aspect="fragility")
Agent: analyze_signals(
  aspect="sparklines",
  metrics="vix,breadth",
  period="60d"
)

Compare today vs 5 days ago

Agent: analyze_signals(aspect="diff", days_back=5)

Drill into the health score

Agent: analyze_signals(aspect="score_breakdown")
  -> per-component points + raw values + bands + active regime overrides

Where’s the dealer-gamma wall?

Operator: "Is there a gamma magnet above us?"
Agent: analyze_signals(aspect="gamma")
  -> read call_wall + put_wall + the per-strike profile.

When to use

When NOT to use

See also