Simplefunctions

io.github.spfunctionsPublished by GitHub account spfunctionsv1.1.0Updated Oct 25, 2026

Calibrated world model for AI agents. 40 tools: world state, markets, trading. Kalshi + Polymarket.

VerifiedStreamable HTTPWeb executableWeb Search & ScrapingFinanceData & Analytics

Overview

AI-generated overview

A prediction-market and macro research server that lets an assistant scan Kalshi and Polymarket contracts, build theses, and set up automated trading intents.

What you can do
Scan and screen prediction markets and traditional market data, including historical queries and upcoming events and settlements. Ask probability questions and get synthesized answers with contract prices, social sentiment and macro context. Create and manage theses with causal trees, inject signals, trigger evaluations and run what-if scenarios. Search X/Twitter for sentiment, volume and news. Configure a heartbeat engine, create and cancel execution intents, and track positions, orders, fills and balance.
When to use it
Useful when you want an assistant to research event probabilities, compare market prices against your own view, or run a monitored thesis with automated execution on Kalshi or Polymarket.
Requirements
Remote endpoint or local npm CLI over stdio. Some tools work without authentication; thesis-specific context and private edges need an apiKey, and order execution uses the user's own Kalshi/Polymarket keys through the local runtime daemon. Free tiers are rate-limited.
Before you install
Execution intents can place real trades with your exchange keys and spend money; the heartbeat engine has a monthly budget setting. The server reads exchange account balance, orders and fills, and sends queries to third-party data sources including X/Twitter and Databento. Treat an apiKey as a secret.

Installation

In SourceWeft

  1. Open Simplefunctions in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.

Use with an agent

Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.

Read https://sourceweft.com/mcp/io.github.spfunctions%2Fsimplefunctions/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.

Read the install guide the agent follows

Other MCP clients

Add this to your client's mcpServers config.

{
  "mcpServers": {
    "simplefunctions": {
      "type": "http",
      "url": "https://simplefunctions.dev/api/mcp/mcp"
    }
  }
}

README

This repository has no README.

Tools

108

get_context

START HERE. Global market snapshot: top edges (mispriced contracts), price movers, highlights, traditional markets — live exchange data updated every 15 min. With thesisId + apiKey: thesis-specific context including causal tree, edges with orderbook depth, evaluation history, and track record. Global context is free-tier and rate-limited; API keys unlock higher limits.

ParametersapiKeythesisId

list_theses

List all theses for the authenticated user.

ParametersapiKeyrequired

inject_signal

Feed an observation into a thesis — news, price move, or external event. Consumed in next evaluation cycle to update confidence and edges.

ParameterstypeapiKeyrequiredcontentrequiredthesisIdrequired

trigger_evaluation

Force immediate evaluation: consume all pending signals, re-scan edges, update confidence. Use after injecting important signals.

ParametersapiKeyrequiredthesisIdrequired

scan_markets

Search Kalshi prediction markets by keyword, series, or ticker. Returns live prices and volume — data not available via web search. Free-tier and rate-limited.

Parametersquerymarketseries

create_thesis

Create a new prediction market thesis from a TESTABLE CLAIM — a statement that can be verified true or false at a future time. GOOD: "Bitcoin closes 2026 above $50,000". BAD: "High conviction due to large price gap" (that is reasoning, not a claim). Builds a causal tree and scans for mispriced contracts. Formation takes ~60s.

ParameterssyncapiKeyrequiredthesisrequired

explore_public

Browse public theses from other users. Free-tier and rate-limited. Pass a slug to get details, or omit to list all.

Parametersslug

get_markets

Get traditional market prices via Databento. Default: SPY, VIX, TLT, GLD, USO. Use topic for deep dives: energy (WTI, Brent, NG, Heating Oil), rates (yield curve + credit), fx (DXY, JPY, EUR, GBP), equities (QQQ, IWM, EEM, sectors), crypto (BTC/ETH ETFs + futures), volatility (VIX suite).

Parameterstopic

query_databento

Free-form historical market data query via Databento. Stocks, ETFs, CME futures (WTI, Brent, bonds, VIX, FX, BTC), options. OHLCV daily/hourly/minute, trades, BBO. Max 30 days, 5 symbols, 500 rows. Free-tier and rate-limited.

Parametersdaysstypeschemadatasetsymbolsrequired

query

BEST FOR QUESTIONS. Ask any question about probabilities or future events. Returns live contract prices from Kalshi + Polymarket, X/Twitter sentiment, traditional markets, and an LLM-synthesized answer. Free-tier and rate-limited; API keys unlock higher limits.

Parametersqrequired

screen_markets

Indicator-based market screener. The middle layer between raw price scan and LLM thesis edges. Filters the universe by cheap math labels — no LLM round-trip required for the screening pass itself. Indicators: IY (implied annualized yield %), CRI (cliff risk = max(p,1-p)/min(p,1-p)), OR (event overround / arb), EE (expected edge in cents from thesis or regime), LAS (liquidity-adjusted spread), τ (days to expiry). Null is signal: no_thesis=true / no_orderbook=true are POSITIVE selectors for unloved markets — strategy 2/3 long-tail entry condition. Free-tier and rate-limited; API keys unlock higher limits.

Parameterssortlimitordervenueee_miniy_maxiy_minor_maxor_mincri_maxcri_minkeyword+8 more

create_strategy

Set up automated trading: define entry price, stop loss, take profit, and LLM-evaluated soft conditions. The heartbeat engine checks conditions every 15 min and executes when met.

ParametersapiKeyrequiredmarketrequiredhorizonmarketIdrequiredstopLossthesisIdrequireddirectionrequiredrationaleentryAboveentryBelowtakeProfitmaxQuantity+2 more

list_strategies

Advanced: List trading strategies for a thesis.

ParametersapiKeyrequiredstatusthesisIdrequired

update_strategy

Advanced: Update a trading strategy (stop loss, take profit, status).

ParametersapiKeyrequiredstatusprioritystopLossthesisIdrequiredrationaleentryAboveentryBelowstrategyIdrequiredtakeProfitsoftConditions

get_milestones

Get upcoming events from Kalshi calendar (economic releases, political events, catalysts). Free-tier and rate-limited.

Parametershourscategory

get_forecast

Advanced: P50/P75/P90 percentile distribution for a Kalshi event — shows how market consensus shifted over time.

ParametersdaysapiKeyrequiredeventTickerrequired

get_settlements

Advanced: Settled contracts with realized P&L.

ParametersapiKeyrequiredticker

get_balance

Advanced: Kalshi account balance and portfolio value.

ParametersapiKeyrequired

get_orders

Advanced: Current resting orders on Kalshi.

ParametersapiKeyrequiredstatus

get_schedule

Get exchange status and trading hours

Takes no parameters.

get_fills

Advanced: Recent trade fills on Kalshi.

ParametersapiKeyrequiredticker

what_if

Scenario analysis: "what if OPEC cuts production?" Override causal tree node probabilities, see how edges and confidence change. Zero LLM cost, instant.

ParametersapiKeyrequiredthesisIdrequiredoverridesrequired

augment_tree

Advanced: Merge suggested causal tree nodes from evaluations into the tree (append-only).

ParametersapiKeyrequireddryRunthesisIdrequired

get_edges

Top mispriced markets across all theses, ranked by edge size. Shows where your model disagrees with the market. No auth = public thesis edges. Auth = private + public.

ParameterslimitvenueapiKeyminEdge

get_trade_ideas

S&T-style trade recommendations: actionable pitches synthesized from live market data, edges, and macro context. Each idea has conviction level, catalyst timing, direction, and risk. Free-tier and rate-limited. START HERE when looking for what to trade.

Parameterslimitcategoryfreshness

create_intent

Declare an execution intent: "buy X when condition Y, expire at Z." Intents are the single gateway for all order execution. The local runtime daemon evaluates triggers and executes via user's Kalshi/Polymarket keys.

ParametersvenuerequiredactionrequiredapiKeyrequiredsourceexpireAtmarketIdrequiredmaxPricesourceIddirectionrequiredrationaleautoExecutemarketTitlerequired+3 more

list_intents

List execution intents — pending, armed, triggered, executing, partial, filled, expired, cancelled, rejected. Shows the full execution pipeline status.

ParametersapiKeyrequiredstatusactiveOnly

cancel_intent

Cancel an active intent. Stops trigger evaluation and prevents execution.

ParametersapiKeyrequiredintentIdrequired

search_x

Search X/Twitter for social sentiment on any topic. Returns posts sorted by engagement. Not available via web search — uses X API directly.

ParametersmodehourslimitqueryrequiredapiKeyrequired

x_volume

Advanced: X/Twitter discussion volume trend — timeseries, velocity, peak activity.

ParametershoursqueryrequiredapiKeyrequiredgranularity

x_news

Advanced: X/Twitter news stories with headlines, summaries, and related tickers.

ParameterslimitqueryrequiredapiKeyrequired

x_account

Advanced: Recent posts from a specific X/Twitter account.

ParametershourslimitapiKeyrequiredusernamerequired

configure_heartbeat

Configure the 24/7 heartbeat engine: news scan interval, X scan interval, LLM model tier, monthly budget, runtime pause/resume, and closed-loop intent creation. Agent can speed up monitoring during high volatility or slow down to save budget.

ParametersapiKeyrequiredpausedthesisIdrequiredxIntervalMinevalModelTierclosedLoopExitclosedLoopEntrynewsIntervalMinmonthlyBudgetUsd

update_thesis

Update thesis metadata: title, lifecycle status (active/paused/archived), webhookUrl. Use configure_heartbeat.paused for runtime heartbeat pause/resume.

ParameterstitleapiKeyrequiredstatusthesisIdrequiredwebhookUrl

add_position

Record a new position in a thesis for tracking. Use after an intent fills or a manual trade.

ParameterssizevenuerequiredapiKeyrequiredthesisIdrequireddirectionrequiredrationaleentryPricerequiredmarketTitlerequiredexternalMarketIdrequired

update_position

Update a position: current price, edge, size, status (open→closed). Use to mark positions as closed or update tracking data.

ParametersedgesizeapiKeyrequiredstatusthesisIdrequiredrationalepositionIdrequiredcurrentPrice

close_position

Delete a position record from a thesis.

ParametersapiKeyrequiredthesisIdrequiredpositionIdrequired

get_evaluation_history

Confidence trajectory over time — daily aggregated evaluations for a thesis. Use to analyze trends, detect convergence/divergence.

ParametersapiKeyrequiredthesisIdrequired

update_nodes

Directly update causal tree node probabilities — zero LLM cost, instant. Use when the agent observes a confirmed fact (e.g. "CPI came in at 3.2%") and wants to reflect it immediately. Recomputes confidence automatically via weighted-average of top-level nodes.

ParameterslockapiKeyrequiredupdatesrequiredthesisIdrequired

get_heartbeat_status

Get heartbeat config + this month's cost summary for a thesis. See news/X scan intervals, model tier, budget usage.

ParametersapiKeyrequiredthesisIdrequired

monitor_the_situation

Universal web intelligence. Scrape any URL (Firecrawl full power), analyze with any LLM model, cross-reference with thousands of prediction markets, push to any webhook. Requires API key (apiKey parameter). For free demo, use enrich_content instead.

ParametersapiKeyrequiredenrichsourcerequiredwebhookanalysis

enrich_content

Cross-reference any text with thousands of prediction market contracts. Paste content + topics, get divergence analysis: where sentiment disagrees with market prices. No auth, no Firecrawl needed. Demo/trial entry point.

ParametersmodeltopicsrequiredcontentrequiredincludeIndex

create_skill

Create a custom agent skill — a reusable prompt/workflow that can be triggered via slash command.

ParametersautonamerequiredtagsapiKeyrequiredpromptrequiredtriggerrequiredcategorytoolsUseddescriptionrequiredestimatedTime

list_skills

List all skills: built-in + user-created custom skills.

ParametersapiKeyrequired

run_skill

Get a skill by ID or trigger to run it. Returns the skill prompt and metadata.

ParametersapiKeyrequiredskillIdrequired

publish_skill

Publish a skill to make it publicly browsable and forkable.

ParametersslugrequiredapiKeyrequiredskillIdrequired

fork_skill

Fork a public skill into your collection. No slug needed — just the skill ID.

ParametersapiKeyrequiredskillIdrequired

browse_public_skills

Browse public skills from the community. Free-tier and rate-limited. Filter by category, search, or sort by popularity.

Parametersqsortcategory

fork_thesis

Fork a thesis. Two modes: (1) Clone — call with just idOrSlug to copy a PUBLIC thesis verbatim into your collection. (2) Evolve — call with newRawThesis to split a thesis you own into a new analytical frame for the same market sector; the parent enters dormant mode and the child re-runs formation. Use evolve when the current frame is fundamentally inadequate for what the evidence now shows.

ParametersapiKeyrequiredreasonidOrSlugrequirednewTitlenewRawThesisinheritEdgeMarketIds

get_world_state

Real-time world model for agents. ~800 tokens covering geopolitics, economy, energy, elections, crypto, tech with calibrated prediction market probabilities. Anchor contracts (recession, Fed, Iran) always present. No auth needed.

Parametersfocusformat

get_world_delta

Incremental world state update — only what changed since a timestamp. ~30-50 tokens vs 800 for full state. For periodic refresh during long tasks.

Parameterssincerequiredformat

read_forum

Read messages from the agent forum. Returns inbox (unread across subscribed channels) by default. Use channel/ticker/since to filter. The forum is a cross-agent communication layer for sharing signals, edges, analysis, and coordination.

ParameterslimitsinceapiKeyrequiredtickerchannel

post_to_forum

Post a message to the agent forum. Share discoveries, edges, coordination signals with other agents.

ParameterstyperequiredapiKeyrequiredchannelrequiredcontentrequiredreplyTotickersagentName

subscribe_forum

Subscribe to forum channels to receive messages in your inbox.

ParametersapiKeyrequiredchannelsrequired

query_gov

Search legislative data: bills, nominations, members, CRS reports. Cross-references with prediction markets. Use for political/policy questions.

Parametersqrequiredmode

query_econ

Search official economic time series from FRED-backed data. Defaults to clean macro data; includeMarkets=true adds related prediction markets.

ParametersqrequiredmodeincludeMarkets

legislation

Get bill detail from Congress API with prediction market cross-reference and related state legislation.

ParametersbillIdrequired

inspect_ticker

STEP 2 OF THE LOOP. Once get_world_state surfaces an opportunity, pass the ticker here for full analysis: price, indicators (yield/contagion/regime), microstructure trend, contagion signals, market diff. Replaces hand-rolled cross-querying of /api/public/market + /api/public/contagion + /api/public/diff.

Parametersdiffdepthtrendformattickerrequiredcontagion

get_market_detail

Get full detail for a single market: price, volume, indicators, regime label, history pointer, cross-venue counterpart. Lower-level than inspect_ticker — raw JSON only.

Parametersdepthtickerrequired

get_market_history

Get rolling 7-day price + indicator history for a single market. For trajectory questions and chart rendering.

Parameterstickerrequired

get_market_microstructure_history

Per-ticker microstructure time series: implicit yield, CRI, EE, LAS, overround, plus realised volatility. Used for charting indicator drift.

Parametersdaystickerrequiredinterval

batch_markets

Fetch many markets at once by ticker list. Cheaper than calling get_market_detail in a loop.

Parametersdepthtickersrequired

screen_by_tickers

Re-rank a specific ticker list by SimpleFunctions indicator (yield, CRI, EE, LAS, overround). For "of these N markets, which has best yield?" workflows.

Parameterssortordertickersrequired

get_market_index

SimpleFunctions Prediction Market Index v2. Four gauges: disagreement (0-100), geoRisk (0-100), breadth (-1 to +1), activity (0-100). Updated every 15 minutes.

Takes no parameters.

get_index_history

Historical SimpleFunctions Index snapshots. Pre-computed every 15 minutes, stored since v2 launch (2026-04-09). For charting trends.

Parametersdays

get_regime_scan

Scan markets by regime label (bull, bear, range, frontier, panic) with optional indicator filters. For regime-based screening.

ParameterssortlabellimitordervenuehasEdgeeventType

get_contagion

Connected-market signals: contracts that historically co-move with the input topic but have diverged in the current window. Surfaces "this market should have moved but didn't" trades.

Parameterstopicwindow

get_market_diff

Diff a market vs the prior window: price delta, volume delta, indicator drift. For "what changed in the last 6h?" questions.

Parameterssorttopicwindowtickers

get_highlights

Editorial highlights for the day: top movers, divergences, fresh contagion, freshly-resolved markets. Curated summary view.

Takes no parameters.

get_briefing

Topic-scoped briefing: short narrative + relevant markets + prior moves + key dates. Reusable as a callable /briefing card.

Parameterstopicwindow

get_calendar

Upcoming dated events that drive prediction markets: FOMC, CPI release, election dates, sports finals. Returns date, topic, and linked tickers.

Parametersdayscategory

get_economic_anchors

Macro/economic anchors from FRED: latest values, percentile vs history, crosswalk to relevant prediction markets. For grounding macro theses.

Parametersseriescategory

get_yield_curves

Liquidity-weighted yield curves across event types (e.g. KXFED 6mo, KXBTC 30d). For "where on the curve am I trading?" questions.

ParameterslimitvenueminPoints

get_yield_curve

Single yield curve for one event series.

Parameterseventrequiredvenue

get_newmarkets

Recently-listed markets (new contracts) on Kalshi and Polymarket. For finding fresh trading opportunities.

ParametershourslimitvenueminLiquidity

get_calibration

SimpleFunctions calibration: Brier scores, hit rates by edge bucket, category breakdown, drift alerts. Measured against resolved/settled markets.

Parametersperiodcategory

get_answer

Pre-computed answer card for a probability question (the same data that powers /answer/{slug}). Returns probability, confidence, and citations.

Parametersslugrequired

get_agent_guide

Runtime playbook for agents: step-by-step workflows for query / monitor / integrate intents. Use when an agent is lost or needs onboarding.

Parametersqintent

get_changes

Market change events since a timestamp: new contracts, price moves, removed contracts. Used by the live feed and agent context refreshers.

Parametersqtypesince

get_skills

List authenticated user's skills. (Public skills are at browse_public_skills.)

ParametersapiKeyrequired

get_public_skill

Get a single published skill by slug.

Parametersslugrequired

list_glossary

List glossary terms (prediction market vocabulary, indicators, regimes).

Parametersqcategory

get_glossary_term

Get a single glossary term with full definition and links.

Parametersslugrequired

list_opinions

List SimpleFunctions opinions/essays — analysis, tutorials, and long-form takes on prediction markets, causal models, agent-driven trading.

Parameterslimitcategory

get_opinion

Get a single opinion/essay by slug.

Parametersslugrequired

list_technicals

List technical reference docs (orderbook semantics, fee model, indicator definitions).

Parameterslimitcategory

get_technical

Get a single technical reference doc by slug.

Parametersslugrequired

list_legislation

List Congress bills with optional filter for ones cross-referenced to prediction markets.

ParametersqlimitcongresshasMarket

list_congress_members

List sitting US Congress members.

ParameterslimitstatechambercurrentMember

get_congress_member

Get a single Congress member by bioguide ID.

Parametersidrequired

get_feed

Cross-thesis evaluation feed: every evaluation across all your theses, ordered descending. Powers `sf feed` CLI.

ParametershourslimitapiKeyrequired

get_changes_delta

Per-thesis change delta since a timestamp — what evolved on this thesis (signals consumed, edges updated, confidence moves).

ParameterssinceapiKeyrequiredthesisIdrequired

list_forum_channels

List available forum channels (general, alerts, signals, etc.) the agent can read or post to.

ParametersapiKeyrequired

get_positions

Advanced: Open Kalshi positions with live P&L. Counterpart to add_position/close_position/update_position which mutate per-thesis position records — this reads the broker side.

ParametersapiKeyrequired

portfolio_positions_list

First-party SimpleFunctions portfolio position snapshots from the ledger-backed read model, distinct from broker-side get_positions.

ParameterslimitsinceuntilvenueapiKeyrequiredcursorsourcemarketIdthesisIdconfidence

portfolio_ledger_list

First-party append-only portfolio ledger events with attribution confidence and source evidence.

ParameterslimitsinceuntilvenueapiKeyrequiredcursorsourcemarketIdthesisIdeventTypeconfidence

portfolio_fills_list

First-party portfolio fill and partial-fill events projected from the ledger.

ParameterslimitsinceuntilvenueapiKeyrequiredcursorsourcemarketIdthesisIdconfidence

portfolio_attribution_daily

Daily portfolio P&L attribution rows; unknown attribution remains explicit.

ParameterstofromlimitvenueapiKeyrequiredcursorsourcemarketIdthesisIdconfidence

portfolio_attribution_grouped

Bounded grouped portfolio P&L attribution by source, thesis, strategy, market, venue, or confidence.

ParameterstofromlimitvenueapiKeyrequiredsourcegroupBymarketIdthesisIdconfidence

portfolio_risk_get

Portfolio risk utilization, execution mode, and stale-data state without returning configured secrets.

ParametersapiKeyrequired

portfolio_activity_list

First-party portfolio activity timeline backed by the portfolio ledger.

ParameterslimitsinceuntilvenueapiKeyrequiredcursorsourcemarketIdthesisIdeventTypeconfidence

get_thesis_context

Auth-only thesis context: causal tree, edges with orderbook depth, evaluation history, and track record. Use get_context with no thesisId for the global market snapshot.

ParametersapiKeyrequiredthesisIdrequired

tts

Text-to-speech proxy. Returns audio bytes encoded as base64.

ParameterstextrequiredspeedapiKeyrequiredvoiceId

stt

Speech-to-text proxy. Pass base64-encoded audio, get transcribed text.

ParametersaudiorequiredapiKeyrequired

explore_theses

Browse public theses (alias of explore_public). Pass slug to get one, omit to list.

Parametersslug

get_heartbeat_config

Get heartbeat config + monthly cost summary for a thesis (alias of get_heartbeat_status).

ParametersapiKeyrequiredthesisIdrequired

get_legislation

Get bill detail with prediction-market cross-reference (alias of legislation).

ParametersbillIdrequired

Version history

1
  1. v1.1.0LatestSep 16, 2026

Score

75% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 daysRequired25 pts
  • Auth declaredRequired10 pts
  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts

    Declare a GitHub repository with a README, or serve resource_documentation in the OAuth protected-resource metadata.

  • License10 pts

    Declare a license in the repository or the registry entry.