Skip to main content
AI Fin Hub

For agents

Entry points for language models, MCP clients and custom agents: a calculator API any agent can fetch, an MCP server, engine modules, tool contracts and routing rules. No sign-in, and open to cross-origin requests.

There are 44 tools at /{slug}/, each with a JSON contract at /contracts/{slug}.json; 44 of them also ship as a static ES module at /engines/{slug}.js. The 1 glossary terms at /learn/{slug}/ carry FAQs, citations and links to the tools, with DefinedTerm and FAQPage structured data.

Run

Run a tool by URL or over MCP

Put the inputs in the query string; an agent that can only fetch pages gets the computed result, the inputs that used defaults, the method page and a citation line:

https://aifinhub.io/api/run/kelly-sizer?win_rate=0.55&win_loss_ratio=1.5&fraction=quarter&max_cap_pct=0.1&trades=500&sims=500&ruin_threshold_pct=0.5&seed=42

{
  "calculator": "kelly-sizer",
  "input": {
    "win_rate": 0.55,
    "win_loss_ratio": 1.5,
    "fraction": "quarter",
    "max_cap_pct": 0.1,
    "trades": 500,
    "sims": 500,
    "ruin_threshold_pct": 0.5,
    "seed": 42
  },
  "defaults_used": {},
  "result": {
    "rawKelly": 0.25,
    "fractionalKelly": 0.0625,
    "cappedBet": 0.0625,
    "…": "…"
  },
  "provenance": {
    "methodology": "https://aifinhub.io/methodology/kelly-sizer/",
    "engine_sha256": "…",
    "…": "…"
  },
  "disclaimer": "Planning estimates only — not financial, tax, or investment advice.",
  "cite": "AI Fin Hub, Kelly Sizer (engine …), https://aifinhub.io/api/run/kelly-sizer?…"
}
  • Add format=md (or send Accept: text/markdown) for a markdown answer; POST a JSON object to the same URL for array inputs such as return series.
  • An unknown or out-of-range input is a 400 that names the field and shows a working example.
  • MCP: add https://aifinhub.io/mcp as a remote server (Streamable HTTP) in any client that takes a server URL. Three tools, find_calculator, run_calculator and list_calculators, so connecting costs a few hundred tokens of context, not one schema per tool. Stateless; the 2026-07-28 protocol and the earlier initialize-based revisions both work.

Discovery

Start here

  • Agent API

    /api

    Run any of the 44 tools by URL: GET /api/run/{slug}?<input>=<value> returns JSON (format=md for markdown); /api/tools lists every tool with its inputs, defaults and an example run.

  • MCP server

    /mcp

    https://aifinhub.io/mcp, Streamable HTTP, stateless, no sign-in. Tools: find_calculator, run_calculator, list_calculators.

  • Engines manifest

    /engines/manifest.json

    Every tool's compute as an ES module at /engines/{slug}.js, for agents that run code: import it and call compute(input) — the same formulas as the calculator pages, with input validated against the published contract and typed .d.ts declarations. Self-contained, for browsers, Deno and Bun (in Node, download the file first). 44 engines. No auth.

  • Full per-engine input/output JSON Schemas + example inputs. Pair with manifest.json when you need shape, not just discovery.

  • Agent tool index

    /agent-tools.json

    Per-tool index. Each entry links to its engine module, contract URL, and input schema.

  • LLM guide

    /llms.txt

    Human-readable entry point for model-aware discovery. Lists every tool, engine, article, benchmark, and glossary entry by URL with a one-sentence summary.

  • Full LLM guide

    /llms-full.txt

    Extended version with descriptions, methodology links, and cross-references.

  • Glossary index

    /tools/

    30 hand-authored glossary entries — risk + portfolio, backtesting, microstructure, AI-in-markets. Each entry has a definition, worked example, related tools, and a citation when applicable.

  • Formulas index

    /tools/

    The equations behind the tools at /formulas/{slug}/ — formula, every variable, a worked example, and common variations. HowTo + cross-linked to the tool that computes it.

  • Guides index

    /tools/

    Task-first how-to guides at /guides/{slug}/ — prerequisites, steps, common mistakes, FAQ. HowTo + FAQPage JSON-LD.

  • Comparisons index

    /tools/

    Structured decision matrices at /compare/{slug}/ — two options, a criterion-by-criterion table, pros, cons, and a verdict. Distinct from the prose /articles/ vs-pages.

  • Plugin manifest

    /.well-known/ai-plugin.json

    Discovery metadata for plugin-style agent ingestion (ChatGPT-style clients).

  • WebMCP manifest

    /.well-known/webmcp.json

    Capability surface for WebMCP-compatible MCP clients.

Engines

44 of 44 static engine modules

Each tool's pure compute is a static ES module at /engines/{slug}.js. Import the module and call compute(input). The same formulas as the calculator pages; input is validated against the published contract; no auth. Self-contained ES2020+ with no external imports, for browsers, Deno and Bun (Node cannot import an https: URL; download the file first, or use the URL API above). Per-engine input/output JSON Schemas in /engines/manifest.json.

const { compute } = await import('https://aifinhub.io/engines/kelly-sizer.js');
const result = compute({ win_rate: 0.58, win_loss_ratio: 2 });
// { rawKelly, fractionalKelly, cappedBet, bucket, sims, finalP5, finalMedian, finalP95, drawdownMedian, ruinRate }
/engines/agent-cost-envelope-calculator.js /engines/agent-skill-tester.js /engines/backtest-overfitting-score.js /engines/batch-vs-realtime-cost-calculator.js /engines/broker-api-comparator.js /engines/calibration-dojo.js /engines/cointegration-half-life-solver.js /engines/correlation-matrix-visualizer.js /engines/data-vendor-tco.js /engines/deflated-sharpe-ratio.js /engines/drawdown-recovery-markov.js /engines/earnings-call-summarization-cost.js /engines/efficient-frontier-builder.js /engines/execution-simulator.js /engines/fallback-chain-simulator.js /engines/finance-mcp-directory.js /engines/financial-document-token-estimator.js /engines/forecast-scoring-sandbox.js /engines/hallucination-detector.js /engines/kalshi-poly-arb.js /engines/kelly-sizer.js /engines/llm-finance-error-taxonomy.js /engines/model-selector-finance.js /engines/options-greeks-explorer.js /engines/options-payoff-builder.js /engines/order-book-replay.js /engines/pair-trading-tester.js /engines/position-sizing-edge-variance.js /engines/price-blind-auditor.js /engines/prompt-injection-tester.js /engines/prompt-regression-tester.js /engines/quant-interview-question-generator.js /engines/returns-distribution-analyzer.js /engines/risk-adjusted-returns.js /engines/sec-filing-chunk-optimizer.js /engines/sharpe-vs-sortino-calculator.js /engines/statistical-arbitrage-capacity.js /engines/structured-schema-validator-finance.js /engines/synthetic-market-data-generator.js /engines/token-cost-optimizer.js /engines/trading-system-blueprinter.js /engines/var-backtest-kupiec-christoffersen.js /engines/walk-forward-validation-visualizer.js /engines/walk-forward-validator.js

Modes

How to invoke

http · mcp · any agent

By URL or MCP (recommended)

GET /api/run/{slug}?… or run_calculator on /mcp: the same engine, run for you, with the defaults it used and the provenance to cite. Works for agents that cannot run code.

static · import · your runtime

Engine module

44 of 44 tools expose a deterministic compute(input) via static ES modules, for agents that run code. Idempotent, cacheable at the edge, no auth; the math runs in your runtime.

const { compute } = await import('https://aifinhub.io/engines/options-greeks-explorer.js');
compute({ type: 'call', spot: 100, strike: 100, vol_pct: 25, days_to_exp: 30, rf_pct: 4.5 });

const { compute: sharpe } = await import('https://aifinhub.io/engines/sharpe-vs-sortino-calculator.js');
sharpe({ returns: [0.001, -0.002, 0.003, /* ... */], rf_annual: 0.045 });

client_side · browser

Visualizer + canvas tools

All 44 tools also run in-browser at /{slug}/ for users who want the rendered chart and interactive controls. Agents should surface the tool URL when the user wants the visual output.

Routing rules

How to pick the right tool

  • Resolve user intent to a tool by category.

    All 44 live at /{slug}/ on the root and are tagged with a section (calculators / comparators / playgrounds / generators / directories).

  • Never invent parameter names.

    Every contract JSON has an explicit input_schema + sample_input. Copy field names verbatim. snake_case.

  • Never claim a result is investment advice.

    All tools are educational under BaFin + EU framework. Relay the disclaimer if surfacing numeric output.

Example contract

What a contract JSON looks like

Every tool has a contract at /contracts/{slug}.json. Example: /contracts/kelly-sizer.json.

{
  "slug": "kelly-sizer",
  "summary": "Kelly bet size from win rate and win/loss ratio (full, half, quarter or eighth Kelly, with a per-trade cap) plus a seeded Monte Carlo of bankroll outcomes: ending-bankroll percentiles, drawdown percentiles and ruin rate.",
  "usage": "Run it over HTTP: GET https://aifinhub.io/api/run/kelly-sizer?<input>=<value>&... returns JSON (add format=md for markdown), or POST the input as a JSON object to the same URL; MCP clients call run_calculator on https://aifinhub.io/mcp. In a browser, Deno or Bun, import https://aifinhub.io/engines/kelly-sizer.js as an ES module and call compute(input) (Node cannot import an https: URL; download the file first). Over HTTP and MCP every field in input_schema is optional: one you leave out takes its documented default, and the result lists the defaults it used. compute(input) on the module applies only the engine's own fallbacks, so pass every input you rely on. Input is validated: an unknown field, a wrong type, or a value outside enum/minimum/maximum is rejected with a message that names the field. The same calculator runs at https://aifinhub.io/kelly-sizer/.",
  "sample_input": {
    "win_rate": 0.55,
    "win_loss_ratio": 1.5,
    "fraction": "quarter",
    "max_cap_pct": 0.1,
    "trades": 500,
    "sims": 500,
    "ruin_threshold_pct": 0.5,
    "seed": 42
  },
  "input_schema": {
    "type": "object",
    "properties": {
      "fraction": {
        "type": "string",
        "description": "Share of full Kelly to bet.",
        "enum": [
          "full",
          "half",
          "quarter",
          "eighth"
        ],
        "default": "quarter"
      },
      "max_cap_pct": {
        "type": "number",
        "description": "Maximum fraction of bankroll per trade as a decimal (0.1 = 10%).",
        "minimum": 0,
        "maximum": 1,
        "default": 0.1
      },
      "ruin_threshold_pct": {
        "type": "number",
        "description": "Bankroll level (decimal of the start) that counts as ruin, e.g. 0.5.",
        "minimum": 0,
        "maximum": 1,
        "default": 0.5
      },
      "seed": {
        "type": "number",
        "description": "Random seed; same inputs and seed give the same result.",
        "default": 42
      },
      "sims": {
        "type": "number",
        "description": "Number of simulated paths (whole number).",
        "minimum": 1,
        "maximum": 20000,
        "default": 500
      },
      "trades": {
        "type": "number",
        "description": "Trades per simulated path (whole number).",
        "minimum": 1,
        "maximum": 2000,
        "default": 500
      },
      "win_loss_ratio": {
        "type": "number",
        "description": "Average win divided by average loss (b).",
        "minimum": 0,
        "default": 1.5
      },
      "win_rate": {
        "type": "number",
        "description": "Probability of a winning trade as a decimal (0.55 = 55%).",
        "minimum": 0,
        "maximum": 1,
        "default": 0.55
      }
    },
    "additionalProperties": false
  }
}

What compute(sample_input) returns from the shipped engine (read at build; long arrays shortened). The simulation is seeded, so the same input returns the same numbers:

{
  "rawKelly": 0.25,
  "fractionalKelly": 0.0625,
  "cappedBet": 0.0625,
  "bucket": "strong",
  "edgeLabel": "Strong edge",
  "sims": 500,
  "trades": 500,
  "finalP5": 1400.4101071832454,
  "finalMedian": 24235.437083888817,
  "finalP95": 285642.19783277286,
  "drawdownMedian": 0.44741468691488795,
  "drawdownP95": 0.6267166598947344,
  "ruinRate": 0.006
}

Input rules for every engine: field names are the snake_case keys in input_schema; every field is optional and falls back to the default shown; enum, minimum and maximum are enforced, and an unknown field or an out-of-range value throws an Error that names the field. Units are in each field's description and x-unit.

Terms

Use by agents is welcome, with conditions

  • Attribute the publisher (AI Fin Hub) when surfacing numeric output to users.
  • Relay the education-only disclaimer verbatim when producing trade-relevant numbers.
  • Do not scrape tool pages for inputs or results: a page fetched without JavaScript shows its default inputs. Read the contract JSON and call /api/run/{slug}.
  • No authentication. The API allows about 120 requests a minute per client; engine modules and contracts are static files.