API

Prediction market API

Kalshi and Polymarket in one endpoint. Context, edge detection, and trading. Your agent connects once.

MCP Server

One command. Claude Code, Cursor, Cline.

claude mcp add simplefunctions \
  --url https://simplefunctions.dev/api/mcp/mcp

18 tools available immediately.

REST API

Standard HTTP. Any language.

curl -H "Authorization: Bearer sf_live_xxx" \
  https://simplefunctions.dev/api/thesis/:id/context

Base URL: simplefunctions.dev

CLI

Terminal-first. 36 commands.

npm install -g @spfunctions/cli
sf setup

Every command supports --json.

Context — primary read endpoint

One call returns everything your agent needs.

GET /api/thesis/:id/context

{
  // Confidence
  "confidence": 0.89,
  "confidenceDelta": 0.02,

  // Causal tree — nodes with updated probabilities
  "nodes": [
    { "id": "n1", "label": "Hormuz closure persists",
      "prob": 0.85, "prevProb": 0.82 },
    ...
  ],

  // Edges — your model vs the market
  "edges": [
    { "market": "WTI T150 YES", "venue": "kalshi",
      "price": 38, "implied": 74, "edge": 36,
      "spread": 1, "depth": 2400, "liquidity": "high",
      "type": "consensus_gap" },
    ...
  ],

  // Last evaluation
  "evaluation": {
    "summary": "Hormuz closure confirmed...",
    "signalsConsumed": 5,
    "trackRecord": { "hitRate": 67 }
  },

  // Open positions with P&L
  "positions": [...]
}

Endpoints

POST/api/thesis/create — Create thesis with causal tree + market scan
GET/api/thesis/:id/context — Full snapshot
GET/api/thesis/:id/changes?since= — Delta check (~50 bytes)
POST/api/thesis/:id/signal — Inject observation
POST/api/thesis/:id/evaluate — Force evaluation
POST/api/thesis/:id/strategies — Create trading strategy
GET/api/thesis — List theses
GET/api/feed?hours=24 — Evaluation history

Auth: Authorization: Bearer sf_live_xxx · Free plan · charge by token after 15M

MCP Tools (18)

Tools marked free work without an API key.

get_contextthesis snapshot
list_thesesall theses
create_thesiscreate + formation
inject_signalpush observation
trigger_evaluationforce eval
augment_treemerge new nodes
what_ifscenario analysis
create_strategytrading strategy
list_strategiesstrategy list
update_strategyupdate params
scan_marketssearch Kalshi + PM
explore_publicbrowse public thesis
get_milestonesevent calendar
get_scheduleexchange hours
get_forecastP50/P75/P90
get_settlementssettled P&L
get_balanceaccount balance
get_ordersresting orders