AI Fin Hub

Playground

Structured Schema Validator for Finance

The sample trade decision JSON passes all 6 field checks with 0 sanity flags.

On the documented defaults, computed by this tool's engine · the same answer as JSON

Structured schema validator finance — paste LLM JSON, see missing fields, type mismatches, enum errors, and plausibility flags.

01Playground

Runs in your browser. Nothing you enter is uploaded, and no account or API key is needed.

Education, not investment advice. Past performance does not predict future results. How we check our numbers.

1. Pick a schema

LLM research note on an investable idea. Must declare a probability, a thesis, and explicit invalidation conditions — every research output that cannot be falsified is just narrative.

Schema definition

FieldType / boundsReq
probabilitynumber [0 … 1]
Subjective probability the thesis plays out. 0..1 inclusive.
required
thesisstring ≥50 chars
Plain-English thesis. Minimum 50 chars — forces substance over one-liners.
required
convictionenum (low|medium|high)
Qualitative conviction bucket.
required
invalidation_conditionsarray ≥1 items
Explicit events that would kill the thesis. ≥1 item.
required
source_citationsarray ≥1 items
URLs or document IDs backing the claims. ≥1 item.
required

Valid example

{
  "probability": 0.62,
  "thesis": "Issuer SYNTHETIC_A's cloud-revenue mix is re-rating vs peers after three consecutive quarters of operating-margin expansion, while the sell-side model still assumes the legacy mix.",
  "conviction": "medium",
  "invalidation_conditions": [
    "Next quarter cloud-revenue growth prints below 20% YoY",
    "Operating margin contracts by more than 150 bps"
  ],
  "source_citations": [
    "10-Q FY2026 Q1, p.14",
    "Earnings call transcript 2026-02-11"
  ]
}

2. Paste your LLM JSON

Validation runs in your browser as you type. Nothing is uploaded.

Schema validity

100%

5 / 5 fields passed, overall pass

Schema: Research Output

3. Validation results

StatusFieldMessage
✓probabilityok
✓thesisok
✓convictionok
✓invalidation_conditionsok
✓source_citationsok

What gets checked

  • Field presence, JSON type, enum values, numeric bounds, minimum string / array sizes.
  • Cross-field sanity (long stops below take-profit, leverage above retail limits, duplicate peer tickers).
  • Soft plausibility bands drawn from real-world issuer filings — out-of-band values warn, not fail.
  • Missing unit / GAAP-basis heuristics for revenue / EPS / EBITDA field names.

02Receipt

What the answer above ran on, how it is computed, where the data comes from, and a link that reopens it.

Inputs

  • jsonobject
  • schema_idtrade_decision

The documented defaults. Change any input above and the tool recomputes.

Method

How the hub's tools are built and checked

Engine /engines/structured-schema-validator-finance.js, sha256 0d97491c763b. The page, the API and MCP run the same file.

Source

Your inputs / BYO key

Page updated .

Permalink

aifinhub.io/structured-schema-validator-finance/

The link carries the inputs you set, so it reopens this result.

03For agents

Any agent can run this calculator by URL or MCP and get the same answer as JSON: the inputs that used defaults, the result and a line to cite. The call below follows the inputs you set above. In code, import the same engine; it runs where you import it, with no request or key.

Requestthe documented defaults
GET https://aifinhub.io/api/run/structured-schema-validator-finance
Response200 application/json · 2.0 KB
{
  "calculator": "structured-schema-validator-finance",
  "title": "Structured Schema Validator for Finance",
  "site": "AI Fin Hub",
  "input": {},
  "defaults_used": {
    "json": {
      "ticker": "AAPL",
      "side": "long",
      "size_shares": 250,
      "rationale": "Earnings beat confirmed the margin-expansion thesis; sized for 1% portfolio risk against the declared stop.",
      "stop_loss": 178.5,
      "take_profit": 212
    },
    "schema_id": "trade_decision"
  },
  "result": {
    "pass": true,
    "fields": [
      {
        "field": "ticker",
        "status": "ok",
        "message": "ok"
      },
      {
        "field": "side",
        "status": "ok",
        "message": "ok"
      },
      {
        "field": "size_shares",
        "status": "ok",
        "message": "ok"
      },
      {
        "field": "rationale",
        "status": "ok",
        "message": "ok"
      },
      {
        "field": "stop_loss",
        "status": "ok",
        "message": "ok"
      },
      {
        "field": "take_profit",
        "status": "ok",
        "message": "ok"
      }
    ],
    "sanityFlags": []
  },
  "provenance": {
    "run": "https://aifinhub.io/api/run/structured-schema-validator-finance",
    "page": "https://aifinhub.io/structured-schema-validator-finance/",
    "methodology": "https://aifinhub.io/structured-schema-validator-finance/",
    "contract": "https://aifinhub.io/contracts/structured-schema-validator-finance.json",
    "engine": "https://aifinhub.io/engines/structured-schema-validator-finance.js",
    "engine_sha256": "0d97491c763b0ce66fb8b9e1a9210b8fea928ecdc122d3e6bae455db3ff52a3c",
    "build": "1a772910d31ef1740892ed0e3a065ed71e8c7406"
  },
  "disclaimer": "Planning estimates only — not financial, tax, or investment advice.",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "cite": "AI Fin Hub, Structured Schema Validator for Finance (engine 0d97491c763b), https://aifinhub.io/api/run/structured-schema-validator-finance"
}
The response for the defaults, as the run URL returns it. Provenance carries the engine hash and build.

How to use it

  1. Pick one of the four reference schemas: research output, trade decision, risk snapshot or peer comparison.
  2. Paste the LLM output JSON. The schema's valid example loads first; Load broken injects typical model errors.
  3. Read pass or fail and the per-field results: missing fields, wrong types, enum and range violations, text that is too short.
  4. Read the sanity flags: values outside plausible bands and cross-field problems, such as a long trade with its stop above its target.
  5. Fix the prompt or schema where fields fail repeatedly, and validate every output in code before it reaches anything that trades.

Questions people ask

What schemas does the validator check?

Four reference schemas for finance LLM outputs: research output, trade decision, risk snapshot and peer comparison. Each defines required fields, types, enums, numeric ranges and minimum lengths, and ships with a valid example. Custom schemas cannot be uploaded.

Why use this instead of plain JSON Schema validation?

The field checks are what JSON Schema does. The extra layer is sanity checking: soft plausibility bands for numbers, and cross-field rules such as stop-loss below take-profit on a long trade, a target ticker repeated in its own peer list, or leverage above Reg T limits. Sanity flags are warnings and do not fail validation.

What does it report?

Pass or fail, a status and message for every schema field, a parse error when the text is not valid JSON, and the list of sanity flags. It validates one output at a time.

Can it validate streaming outputs?

Only complete JSON. Validate the output once the stream has finished; a partial document fails to parse.

How strict should I make the schema?

Strict enough to catch real errors, loose enough not to reject legitimate variation. A common pattern is tight validation on machine-consumed fields (numbers, enums, IDs) and looser validation on human-readable ones (descriptions, summaries).

  • Playgrounds Hallucination Detector

    Paste a source document + an LLM's extraction. Every numeric claim in the output is checked against the source. Client-side. Catches silent fabrication before it ends up in your pipeline.

  • Playgrounds Agent Skill Tester for Markets

    Paste a SKILL.md definition + sample input + your Anthropic API key. See structured extraction, token cost, and latency — all in your browser. No signup, key never leaves the page.

  • Playgrounds Prompt Regression Tester

    Run the same prompt against current Claude, GPT and Gemini models with your own keys. Diff outputs, score drift, catch regressions.

All articles