AI Agent & Programmatic Access
Last verified
The platform exposes the same signal intelligence three ways β a versioned JSON REST API, a Model Context Protocol (MCP) server, and a Server-Sent Events (SSE) push stream. Every surface returns the same numbers from the same in-process helpers, so an agent reading /signals/latest, calling the MCP market_pulse tool, and watching the SSE stream cannot see the dashboard drift from itself.
Your environment
- Base URL:
https://bigclawd.comβ versioned routes live under/api/v1/... - Timezone: Eastern Time (ET). Every persisted and emitted timestamp is ET ISO 8601 with explicit offset (Law 1).
- Asset universe: stocks, ETFs, options supported by the brokerage market-data feed.
/api/v1/trading/tickersreturns a curated S&P 500 + ETF reference list. - Market hours: MondayβFriday, 09:30β16:00 ET. Public read routes serve 24/7; trading routes enforce the clock at both initiation and confirmation. Full release / cycle / lifecycle posture lives at
/kb/operations/schedule.
Three ways to consume
REST JSON API. 104 routes under /api/v1/.... Public read routes (signals, alerts, reports, agents) are unauthenticated; trading routes require a Bearer token; FinRep-AI + ai-brief routes require an internal token. Versioned; pinned via schema_version on every typed surface. β details below and per-route articles at /kb/api.
MCP server. 11 tools at https://bigclawd.com/mcp β 8 public (no auth), 3 trading (Bearer token in Authorization). Suitable for Claude Desktop, Claude Code, Cursor, and any other MCP-aware client. Each tool wraps a curated cluster of REST routes into one round-trip. β details at /kb/mcp and the per-tool articles.
SSE event stream. GET /api/v1/agents/stream opens a persistent connection. Emits a snapshot event on connect, then regime_change, critical_fired, critical_resolved events as they happen, plus a heartbeat every ~30s of silence. Use instead of busy-looping /agents/pulse when you want push notification of regime flips and critical alerts. β details at /kb/api.
Authentication
Four tiers. The header / posture each surface requires:
Auth tiers β pick the right one before you call
The X-Internal-Token tier is what gates /finrep-ai/*, /ai-brief/*, /ai1/*, /ai2/* (except the two deliberate public exceptions, /ai2/verdict and /ai2/history), brief calibration + drift + datapoints + pack-stats + calendar-lookahead, and the FinRep-AI usage ledger, plus a handful of internal-token routes on the company/screener surfaces. Public clients without the header get 401; misconfigured deployments (env var unset on the backend) return 503 with a CRITICAL server-side log. The count churns as the platform grows β CLAUDE.mdβs route-decorator inventory is the live source of truth (42 as of this writing); treat β40+β here as a floor, not a ceiling. The catalog generator excludes them from the public per-route articles, so they only surface here.
Common queries β worked examples
Start every session with /agents/pulse. Drill into the typed shape when you need it.
Start-of-session pulse check
One round-trip; same helpers as the rendered report.
curl -s https://bigclawd.com/api/v1/agents/pulse
Returns {schema_version, generated_at, age_seconds, regime, health_score, headline, summary, what_changed, active_alerts: {count, by_severity, top: [...]}, key_numbers: {...}}. Mirrors /signals/latest so the agent narrative cannot drift from the dashboard. β details at /kb/api/get-agents-pulse.
The MCP equivalent is the market_pulse tool β same payload, slightly trimmed for token economy. β /kb/mcp/market-pulse.
Full signal snapshot
curl -s https://bigclawd.com/api/v1/signals/latest
Carries schema_version: "2027.28" and ~40 typed sub-objects (positioning, correlations, energy, inflation, volatility, zero_dte, gamma_levels, dealer_gamma, alignment, freshness, rotation, β¦). Pin on schema_version if your code depends on the shape. The legacy ?flat=* shim returns HTTP 410 Gone β read the typed sub-objects, not the flat duplicates (Law 5).
Event feed β transition stream
curl -N https://bigclawd.com/api/v1/agents/stream
-N disables curlβs output buffering so the SSE frames arrive as they fire. Use this instead of polling /agents/pulse every 5 seconds β the server polls every 5s internally and pushes the deltas. Heartbeat every ~30s tells you the connection is alive. β details at /kb/api/get-agents-stream.
Historical pattern match β βwhen has this happened before?β
curl -s 'https://bigclawd.com/api/v1/signals/base-rates?mode=hybrid&top_k=100'
Matches todayβs 13-numeric + 3-categorical signal vector against history. Returns forward 1d/3d/5d SPY return distribution with bootstrap CIs across the top-K analogues. Pin on the response payloadβs own matcher_version field β read it fresh each call rather than hardcoding a copy here; it churns whenever the matcherβs dims, weights, or gates change (see CLAUDE.mdβs Historical Base Rate Engine section for the bump policy). Defaults to mode=soft; pass mode=hybrid to opt into the tag-prefilter + Euclidean dispatch β per DOCTRINE P0 the response surfaces hybrid_fallback=true when the filter under-shoots 30 analogues and the matcher fell back to unfiltered Euclidean. β matcher details at /kb/framework/hybrid-matcher. MCP equivalent: /kb/mcp/compare-to-history.
Position-read β filter dashboard noise to your book
curl -s 'https://bigclawd.com/api/v1/agents/position-read?symbol=SPY&side=long&type=call&expiry=2026-06-21&strike=560'
Returns only the signal categories, active alerts, regime factors, and alignments that materially affect that specific position. Use when youβre holding ten positions and donβt want to re-derive relevance for each from the full snapshot. β details at /kb/api/get-agents-position-read.
REST API surface
112 routes across five files. Each row links into the per-endpoint article at /kb/api/<slug> (where the catalog generator has built one). Counts per group:
| Group | Count | Where they live | Auth |
|---|---|---|---|
| Agents (pulse, stream, position-read) | 3 | app/signals/routes.py |
Public |
| Signals (latest, score, history, alignment, base-rates, β¦) | ~25 | app/signals/routes.py |
Public |
| Alerts (active, today, summary, history, check, β¦) | 5 | app/signals/routes.py |
Public |
| Reports (latest, by filename, week) | 4 | app/main.py |
Public |
| Trading public (quote, quotes, options/chain, tickers, market/status, limits) | 6 | app/trading/routes.py + options_routes.py |
Public |
| Trading agent (account, positions, trades, history, pending) | 8 | app/trading/routes.py + options_routes.py |
Bearer |
| Trading admin (accounts, reset, history, events, snapshots, equity-curve, recent-trades) | 10 | app/trading/routes.py |
Admin Bearer |
| Admin alerts + webhooks (CRUD + evaluate + test) | 12 | app/signals/routes.py |
Admin |
| FinRep-AI + ai-brief + AI-1/AI-2 (analyze, usage, brief latest/history/by-id/accuracy/stance-tally, brief calibration Γ3 + drift, datapoints Γ3, pack-delta, pack-stats, calendar-lookahead, AI-1 raw-analysis read, AI-2 compare + 5 standing graders + memory Γ2) | 26 | app/signals/ai_brief_routes.py (the FR-008 extraction, folded back into the signals router) |
X-Internal-Token |
Infrastructure (/health, /healthz, /metrics, /status, /source-health, β¦) |
~13 | app/main.py |
Public |
β Full per-route articles at /kb/api. Trading specifics are at /kb/framework/trading.
MCP surface
11 tools. The MCP transport is JSON-RPC over HTTP (no SSE); every tool is a synchronous round-trip that wraps the corresponding REST cluster.
| Tool | Auth | Wraps | KB article |
|---|---|---|---|
market_pulse |
Public | /agents/pulse |
/kb/mcp/market-pulse |
get_quote |
Public | /trading/quote/{symbol} + /trading/quotes |
/kb/mcp/get-quote |
option_chain |
Public | /trading/options/chain/{symbol} |
/kb/mcp |
read_report |
Public | /reports/latest + /reports/{filename} |
/kb/mcp |
analyze_signals |
Public | /signals/latest + /signals/score/breakdown |
/kb/mcp |
compare_to_history |
Public | POST /signals/base-rates/compare |
/kb/mcp/compare-to-history |
screener_board |
Public | /screener/company-action-board + /screener/candidates + /screener/board-track-record |
/kb/mcp/screener-board |
ai_brief |
Public | /ai2/verdict + /ai2/history |
/kb/mcp/ai-brief |
portfolio_status |
Bearer | /trading/account + /positions + /positions/options |
/kb/mcp |
plan_trade |
Bearer | POST /trading/trades or /trades/options |
/kb/mcp |
execute_trade |
Bearer | POST /trading/trades/{id}/confirm / DELETE |
/kb/mcp |
Client config (Claude Desktop / Claude Code / Cursor):
{
"mcpServers": {
"bigclawd": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://bigclawd.com/mcp"]
}
}
}
For Bearer-gated tools, add the token to the upstream environment per your clientβs docs β never embed it in the JSON checked into source. β full per-tool detail at /kb/mcp.
Trading
A fully separate agent-facing surface β paper-tracked positions in /app/data/trading.db, real brokerage market prices, two-step plan-then-confirm flow with a 60-second quote window, single-execute claim via BEGIN IMMEDIATE. Account model, order shapes (stocks vs options β different endpoints!), guardrails (non-binding by default β cash is the real cap; read GET /trading/limits for the live values), and admin endpoints all live at /kb/framework/trading. Read that page before sending the first POST /trades.
Alerts for agents
The platform fires 63 defined alerts when signal conditions cross threshold (see the full catalog at /kb/alerts). Agents subscribe in three ways: poll GET /alerts/active for the current state, subscribe to GET /agents/stream (SSE) for real-time regime changes + critical fires, or register an alert_fired / alert_resolved webhook via the admin endpoints. Payloads include alert_id, severity, rendered message, and the signal value that triggered the fire.
Response conventions
schema_versionpinning. Every typed surface emits aschema_versionconstant (/signals/latestβ"2027.28";/signals/alignmentβ"2026.07"; per-route versions on the calibration / drift / datapoints surfaces). Bumped on breaking shape changes; pin on it if your code reads the typed objects.- Law 1 timestamps. Every persisted and emitted timestamp is ET ISO 8601 with explicit offset (
"2026-05-04T14:30:00-04:00"). Round-trips throughdatetime.fromisoformat(). Display layers emit ET β they never need to convert. - Law 5 typed sub-objects. Group-related signals live under typed paths (
energy,inflation,volatility,correlations,gamma_levels,zero_dte,alignment,positioning,freshness,rotation). The flatsignalsdict prunes anything that has a typed home.?flat=*returns HTTP 410 β no escape hatch. - Freshness classes. Every metric carries a publish-cadence tag:
intraday,prior_close,weekly,monthly,quarterly,ad_hoc. Plus a staleness layer withmax_age,age_seconds,statusβ stale. Read both before trusting a value β see the per-metricfreshnesssub-object on/signals/latest. - Empty data is loud. Sparse windows on the brief calibration / drift / datapoints surfaces return HTTP 200 with explicit zero counts and a
_legacy_rows_skipped/unmatured_briefsfield rather than 404 (DOCTRINE P0 β never silently drop, never mask coverage gaps).
Rate limits and caching
Moving-window limiter; exceeded requests return 429 Too Many Requests with a Retry-After header and {error, message, retry_after} body. Back off exponentially (2s β 4s β 8s, capped at Retry-After).
| Route class | Limit | Key |
|---|---|---|
/api/v1/* (public reads) |
60 req/min | client IP (X-Forwarded-For / CF-Connecting-IP aware) |
/api/v1/trading/* |
120 req/min | Bearer token fingerprint (sha256 prefix); falls back to IP if no token |
/admin/*, /health, /metrics, / |
unthrottled | β |
Cache-Control headers per path class:
| Path class | Header |
|---|---|
Archive reports (/api/v1/reports/report-YYYYMMDD-HHMMSS.md) |
public, max-age=86400, stale-while-revalidate=86400 |
Historical series (/signals/history, /signals/sparklines, /signals/regime-log, /signals/base-rates, /reports/week/*) |
max-age=300, stale-while-revalidate=600 |
Live snapshots (/signals/latest, /alerts/active, /agents/pulse, /status) |
max-age=30, stale-while-revalidate=60 |
Trading, admin, /metrics, /health |
no-store |
Steady pollers: cap at β€1 req/sec per token to stay well under the 120/min trading limit with headroom for bursty confirms. Prefer /agents/stream over busy-loop polling when you need event latency.
Error semantics
- 401 β missing or invalid auth. Bearer absent / wrong token. For
X-Internal-Token, the header didnβt match; forAuthorization: Bearer, the trading token didnβt match. Donβt retry; fix credentials. - 403 β auth present but wrong tier (e.g. agent Bearer hitting an admin route). Donβt retry.
- 410 Gone β
?flat=*on/signals/latest. Read the typed sub-objects instead. No escape hatch. - 429 β rate limited. Back off per
Retry-After. Exponential retry (capped atRetry-After); never tight-loop. - 503 β backend not ready or
X-Internal-Tokenenv var unset (default-deny on internal routes). Retry after a few seconds; check/healthto see if the backend is up.
Trading-specific:
- 400 with
detaildict onPOST /trades/optionsβexpired_expiration/non_trading_day/no_market/contract_not_found. Parse the dict; donβt string-match the message. - 400 on confirm β status was already
executing/executed/cancelled. Concurrent confirms hit a single-claim guard; only the first request proceeds. - Market closed on
POST /trades*andPOST /trades/{id}/confirmβ check/trading/market/statusbefore the call.
Rules and limitations
- Law 3 β one canonical name per concept. βGEXβ specifically means aggregate dealer gamma from the third-party dealer-gamma analytics feed. The brokerage option-chain per-strike profile is βGamma Wallsβ (
gamma_levels). The per-tickergamma Γ OIproxy is βΞ³-Sent / Gamma Skewβ β never call it GEX. news_sentimentalignment category is flag-gated. 11 categories ship by default; the 12th (news_sentiment) is gated behindENABLE_AI_SENTIMENT_ALIGNMENT. Default off β the alignment response is the 11-category shape until the calibration gate flips it on.- No SSE in MCP transport. MCP is request/response over JSON-RPC; the
/agents/streampush surface lives only on the REST API. - Market-hours enforcement on trading tools.
plan_tradeandexecute_tradeenforce 09:30β16:00 ET, MondayβFriday, US-equity holiday-aware. The MCP wrappers inherit the same rejection β checkmarket_pulsefirst. - Whole shares only, long only. No fractional shares, no short selling, no naked option writing.
- 60-second confirmation window. Quote expires automatically; reset by re-planning. Confirm immediately after
plan_trade.
Schema version reference
| Surface | Constant | Value |
|---|---|---|
/signals/latest |
SIGNALS_LATEST_SCHEMA_VERSION |
"2027.28" |
/signals/alignment |
ALIGNMENT_SCHEMA_VERSION |
"2026.07" |
| Health score formula | SCORE_FORMULA_VERSION |
"2026.04.3" |
| Base-rate matcher | MATCHER_VERSION |
see the live matcher_version field on the /api/v1/signals/base-rates payload β the string churns with matcher tuning, so this table points at the field rather than caching its value |
/ai-brief/calibration-by-sentiment |
AI_BRIEF_CALIBRATION_SCHEMA_VERSION |
"2026.05.2" |
/ai-brief/calibration-by-facet |
AI_BRIEF_CALIBRATION_FACET_SCHEMA_VERSION |
"2026.05.1" |
/ai-brief/accuracy |
AI_BRIEF_ACCURACY_SCHEMA_VERSION |
"2026.05.1" |
/ai-brief/calibration-drift |
AI_BRIEF_CALIBRATION_DRIFT_SCHEMA_VERSION |
"2026.05.1" |
/ai-brief/datapoints* |
AI_BRIEF_DATAPOINTS_SCHEMA_VERSION |
"2026.05.2" |
/ai-brief/sentiment-sparkline |
(inline) | "2026.05.2" |
/ai-brief/pack-delta |
AI_BRIEF_PACK_DELTA_SCHEMA_VERSION |
"2026.05.1" |
/ai-brief/pack-stats |
AI_BRIEF_PACK_STATS_SCHEMA_VERSION |
"2026.05" |
/ai-brief/calendar-lookahead |
AI_BRIEF_CALENDAR_LOOKAHEAD_SCHEMA_VERSION |
"2026.05" |
| AI brief signal pack | (inline) | "2026.05.4" |
Pin on these. Bumps are loud β every new shape adds an integer / dot-segment, never silently mutates an existing one.
See also
/kb/framework/tradingβ trading-specific surface (account, orders, options, guardrails, admin)./kb/framework/hybrid-matcherβ base-rate matcher modes, tag pre-filter, fallback rule./kb/framework/five-level-scaleβ universal signal classification (Favorable / Leaning / Neutral / Cautionary / Adverse)./kb/framework/regime-overridesβ regime-conditional health-score weighting schema./kb/framework/alignmentβ 12-category signal-price alignment methodology./kb/indicators/health-scoreβ 18-component composite scoring./kb/alertsβ full alert catalog (63 defined)./kb/operations/scheduleβ cycle profiles + release calendar./kb/operations/source-healthβ per-source health surface./kb/apiβ per-route catalog (auto-generated)./kb/mcpβ per-tool catalog.