QuantZ
Checking sign-in status

For agents

The MCP tools: what each takes and returns, as the server registers it, what every result carries, when it refuses, and the switches that turn it on.

A machine-readable index of this product is served at /llms.txt. The pages it points at are the same ones a person reads: indicators, shapes, the refusal census.

Status

The tools below are served over the Model Context Protocol (Streamable HTTP, JSON-RPC over POST, stateless) at /api/mcp, by src/app/api/mcp/route.ts. The operator switches the server on with QUANTZ_MCP_ENABLED=1; read_chart and null_benchmark also need QUANTZ_MCP_MARKET_DATA=1 before they serve vendor bars. On this deployment the server is off, so /api/mcp answers 404 with no body.

The contract

  • Read-only, apart from sealing your own pre-registration. No tool places, changes or cancels an order, sets an alert, edits a watchlist, signs in or buys anything. The copilot that runs today is held to the same allowlist, in code and in tests.
  • Every result carries a provenance block: who produced the numbers, as of when, how old they were, and the trial count behind any Sharpe ratio.
  • Every refusal carries a code and a reason about the input. A tool that declines says why, in a sentence, rather than returning an empty or invented value.
  • No tool makes a recommendation. Tools describe bars, arithmetic and records; the same lint that reads the product’s copy for advice vocabulary reads a tool’s prose.
  • A Sharpe ratio never appears without its Deflated Sharpe Ratio and the trial count beside it.
  • Vendor bars reach an agent only once the operator has confirmed the licence allows it (the market-data switch below); until then the two tools that read bars refuse and say so.

Provenance on every result

  • vendor · string · Who produced the numbers: the vendor that answered from our own bar store, "caller-supplied" for series the caller sent, or the engine adjudication for the census.
  • asOf · string | null · ISO-8601 instant the newest input closed (the last served bar, the seal time, the grading date); null when the input carries no clock.
  • ageSeconds · number | null · Seconds between asOf and the server clock at the call; null when asOf is null.
  • model · null · Always null: no model runs on this surface. Every sentence is computed.
  • trialCount · number | null · The N behind any Sharpe in this result; null where none is reported.
  • trialsSource · string | null · How that N was obtained. "caller-supplied" means the caller stated it and the server hosted no search to count.
  • timeframe · string · optional
  • interval · string · optional · The backend interval the bars were fetched at.
  • barsUsed · number · optional
  • tier · fresh | delayed · optional · fresh: every bar the store holds; delayed: bars closed at least delayFloorSeconds ago.
  • delayFloorSeconds · number · optional
  • withheldBars · number · optional · Bars newer than the delayed floor that were not served on this tier.
  • staleAfterSeconds · number · optional · Age past which this timeframe is refused as stale.
  • freshRefusal · quota | signin | meter | null · optional · Why an explicit fresh=true was served delayed: the monthly live-session allowance is spent, there is no account to meter, or the meter itself is unavailable (it fails closed to the delayed floor).
  • licence · confirmed | pending-confirmation · optional · For results derived from vendor bars: the operator's confirmation that they may be served to agents (QUANTZ_MCP_MARKET_DATA). 'pending-confirmation' accompanies a refusal, never data.

Tools

The inputs and outputs below are read from the schemas the server registers, so they are the server’s own; its tools/list returns the same.

read_chart · off here

Needs QUANTZ_MCP_ENABLED=1 and QUANTZ_MCP_MARKET_DATA=1

The structured reading the terminal’s Analysis panel produces, over bars from our own store: the trend and the rule that decided it, the newest candle patterns, one reading per study, the nearest swing levels, the volume line and a tally. It returns readings, not the bars themselves.

Who may call it · Anyone. An anonymous caller reads the delayed tier; a session or API token reads the tier its plan allows.

Inputs

  • symbol · string · Ticker as our bar store names it, e.g. AAPL, SPY, BTC-USD.
  • timeframe · 1m | 5m | 15m | 30m | 1H | 4H | 1D | 1W | 1M | 3M | 12M (default "1D") · optional · Candle size in the chart's vocabulary. 1M/3M/12M are calendar candles built from daily rows.
  • window · integer · optional · Bars to read; defaults to the chart's own window for the timeframe.
  • studies · object[] · optional · Studies to read instead of the defaults (SMA 20, EMA 9, RSI 14).
  • fresh · boolean (default false) · optional · A metered account spends one live-data session for the live tier. Never spent silently; paid plans are always live; anonymous callers are always on the delayed tier.

Outputs (besides provenance)

  • symbol · string
  • timeframe · string
  • interval · string
  • studies · object[] · The studies that were read. Defaults: SMA(20), EMA(9), RSI(14), plus the volume line.
  • volumeRead · boolean
  • lastClose · number
  • trend · object
  • patterns · object[] · The newest candle patterns, newest first — the shape, never a forecast.
  • patternsDetected · number · Patterns over every served bar.
  • indicators · object[]
  • levels · object[]
  • volume · object | null
  • tally · object
  • summary · string · One sentence of counts. "Mixed" when the readings disagree.

Refuses, with a code and the reason, when

  • MARKET_DATA_PENDING — QUANTZ_MCP_MARKET_DATA is not '1' on this deployment, so no vendor bars are served to agents
  • INVALID_SYMBOL — the symbol is not one the server accepts
  • NO_BARS — our vendor layer has no bars for the symbol at that interval; nothing is invented in their place
  • TOO_FEW_BARS or DELAYED_FLOOR — too few bars to read, or too few once the delayed tier has withheld bars inside its floor
  • STALE_DATA — the newest served bar is older than the timeframe’s staleness ceiling
  • UNKNOWN_STUDY — a study id that is not in the indicator registry

In the product · The Analysis tab of /terminal, computed in the browser from the same libraries.

audit_backtest · off here

Needs QUANTZ_MCP_ENABLED=1

What a Sharpe ratio is worth given the search behind it: the Deflated Sharpe Ratio, the no-skill expected maximum for that many trials, the minimum backtest length, the minimum track record length, Lo’s serial-correlation correction, and PBO by CSCV when a returns matrix is supplied.

Who may call it · Anyone. It reads only the series the caller sends.

Inputs

  • returns · number[] · Per-period simple returns of the equity curve, oldest first (0.01 = +1%). Non-finite entries are dropped and counted, never filled.
  • trials · number · optional · REQUIRED — the number of configurations tried before this one was chosen; the N the Deflated Sharpe deflates by. There is no default.
  • periodsPerYear · number · optional · Observations per year (default 252, daily sessions).
  • riskFreeAnnual · number · optional
  • years · number · optional · Elapsed years, if the series has gaps; defaults to nObs / periodsPerYear.
  • matrix · number[][] · optional · T rows × N configurations of per-period returns, rows aligned in time, for PBO by CSCV. At most 200 configurations.
  • cscvBlocks · integer · optional · Even block count for CSCV (default 16 → C(16,8) splits).
  • label · string · optional

Outputs (besides provenance)

  • label · string
  • nObs · number
  • nDropped · number · Non-finite entries dropped from the series; never filled.
  • years · number
  • periodsPerYear · number
  • sharpe · number | null · Annualised Sharpe ratio; null where undefined (too few observations, or no variance).
  • deflatedSharpeRatio · number | null · Probability the Sharpe reflects skill rather than selection, given nTrials.
  • nTrials · integer
  • trialsSource · string
  • sharpeStandardError · number | null
  • skewness · number | null
  • kurtosisRaw · number | null
  • expectedMaxSharpeNoSkill · number | null · The Sharpe that searching nTrials configurations with zero skill is expected to find.
  • luck · string
  • minimumBacktestLengthYears · number | null
  • historySufficientForTrialCount · boolean
  • minTrlVsSelectionYears · number | null · Track record needed to beat the no-skill maximum at minTrlConfidence; null when the Sharpe does not exceed it.
  • minTrlVsZeroYears · number | null
  • minTrlConfidence · number
  • serialCorrelation · object · Lo's correction for serially correlated returns; the adjusted Sharpe reads with the DSR and nTrials above.
  • pbo · object | null · Probability of Backtest Overfitting by CSCV, when a matrix was supplied.

Refuses, with a code and the reason, when

  • UNRANKABLE — the trial count is missing; it is required and never defaulted
  • matrix-too-large — the returns matrix has more configurations than the server reads
  • too-few-observations — fewer usable observations than a Sharpe ratio needs
  • sharpe-undefined — the series has no usable variance
  • the arithmetic’s own refusals (for example a CSCV split it cannot make), passed through with their codes

In the product · /audit runs the same arithmetic in the browser (src/lib/overfit.ts), with no endpoint, so a curve pasted there stays on the reader’s machine.

null_benchmark · off here

Needs QUANTZ_MCP_ENABLED=1 and QUANTZ_MCP_MARKET_DATA=1

What holding the instrument did over the same window: buy-and-hold, and the constant-risk hold sized from trailing realised volatility through the Strategy Lab’s fill rules, each with total return, maximum drawdown, and its Sharpe beside the Deflated Sharpe Ratio and n = 1.

Who may call it · Anyone, on the same data tiers as read_chart.

Inputs

  • symbol · string · Ticker as our bar store names it, e.g. AAPL, SPY, BTC-USD.
  • timeframe · 1m | 5m | 15m | 30m | 1H | 4H | 1D | 1W | 1M | 3M | 12M (default "1D") · optional
  • window · integer (default 252) · optional · Bars to measure over, after the volatility warm-up.
  • fresh · boolean (default false) · optional · A metered account spends one live-data session for the live tier. Never spent silently; paid plans are always live; anonymous callers are always on the delayed tier.
  • feeBps · number (default 10) · optional
  • slippageBps · number (default 0) · optional
  • targetVolAnnual · number (default 0.2) · optional · Annualised volatility the constant-risk hold is sized to (the Lab's default 0.20).
  • volWindow · integer (default 20) · optional · Trailing bars the realised volatility is measured over.
  • maxExposure · number (default 1) · optional · Ceiling on the fraction of equity held; never above 1 — the null cannot borrow.

Outputs (besides provenance)

  • symbol · string
  • timeframe · string
  • interval · string
  • window · object · The shared window both lines are measured over; the bars before it seed the volatility estimate.
  • costs · object · lib/fills.ts's rules on every rebalance of the constant-risk hold: adverse slippage on the traded side, the fee on the traded notional. Buy-and-hold is the Lab's costless reference line.
  • periodsPerYear · number · Bars per year for descriptive statistics, from the disclosed market/session convention or supplied tape's density. The hold's causal sizing basis is reported separately.
  • annualization · object
  • buyAndHold · object
  • volTargetedHold · object

Refuses, with a code and the reason, when

  • MARKET_DATA_PENDING — QUANTZ_MCP_MARKET_DATA is not '1' on this deployment, so no vendor bars are served to agents
  • INVALID_SYMBOL — the symbol is not one the server accepts
  • NO_BARS — our vendor layer has no bars for the symbol at that interval; nothing is invented in their place
  • TOO_FEW_BARS or DELAYED_FLOOR — too few bars to read, or too few once the delayed tier has withheld bars inside its floor
  • STALE_DATA — the newest served bar is older than the timeframe’s staleness ceiling
  • too-few-bars, bars-not-finite or sharpe-report-refused — the benchmark arithmetic’s own refusals

In the product · The Strategy Lab (/lab) draws the same two null lines beside every backtest.

preregister · off here

Needs QUANTZ_MCP_ENABLED=1

Seal a falsifiable claim (hypothesis, universe, success criteria, sample window, an optional holdout and configuration hash) into the caller’s append-only, hash-chained research ledger, and return the sealed record with the chain head.

Who may call it · A signed-in caller, or an API token created in Settings → Security, sent as “Authorization: Bearer qz_…”.

Inputs

  • hypothesis · string · What is claimed, specific enough that a result could contradict it.
  • universe · string · What it will be tested on — instruments, sector, index membership.
  • criteria · string · What would count as success, decided in advance.
  • sampleStart · string · YYYY-MM-DD
  • sampleEnd · string · YYYY-MM-DD
  • holdoutStart · string · optional · YYYY-MM-DD; both holdout dates or neither.
  • holdoutEnd · string · optional
  • configHash · string · optional · Lowercase hex sha256 of the configuration this claim commits to; bound into the sealed criteria text.

Outputs (besides provenance)

  • seq · number
  • ts · string
  • recordHash · string
  • prevHash · string
  • headHash · string
  • chainLength · number
  • hypothesis · string
  • universe · string
  • criteria · string
  • sampleStart · string
  • sampleEnd · string
  • holdoutStart · string | null
  • holdoutEnd · string | null
  • configHash · string | null
  • claim · string · What the chain proves, in the words the product renders.

Refuses, with a code and the reason, when

  • AUTH_REQUIRED — an anonymous call; a registration belongs to one person’s ledger
  • INVALID_<FIELD> — a field that fails validation, named in the code
  • the ledger’s own refusals (for example a contended append), with their codes

In the product · Signed-in readers have the same vault and ledger at /research.

refusal_census · off here

Needs QUANTZ_MCP_ENABLED=1

The graded counts of Campaign 2 (declared tapes, determinations, and the SELECTED / CANDIDATE / REFUSAL / ERROR split per universe) beside the bar every tape was measured against, as it was sealed in advance. Counts only; no symbol.

Who may call it · Anyone.

Inputs

None.

Outputs (besides provenance)

  • campaigns · object[]

Refuses, with a code and the reason, when

  • Nothing: it takes no input, and its counts are a fixed transcription of the adjudications.

In the product · /docs/refusals prints the same census.

Read-only surfaces you can call today

Each entry names the file in the repository that serves it. An agent that reads these reads the same payloads the product’s own pages read.

  • /llms.txt · the machine-readable index of this productpublic/llms.txt
  • /api/ohlcv/{symbol}?tf=1day&limit=500 · bars for one symbol at one interval, with their source named: the vendor that served them, or db when they came from our own stored history; per-address rate limitsrc/app/api/ohlcv/[ticker]/route.ts
  • /api/quote/{symbol} · the latest quote with its source and timesrc/app/api/quote/[ticker]/route.ts
  • /api/vendors · the vendor fallback chain for each asset class and whether bars are kept in our store; it carries no check timesrc/app/api/vendors/route.ts
  • /api/fundamentals/{symbol} · filed fundamentals from SEC EDGAR, cited by accession numbersrc/app/api/fundamentals/[ticker]/route.ts
  • /docs/indicators/{id} · what each registry indicator computes and assumes, whether it repaints, and what lies outside its inputssrc/app/docs/indicators/[id]/page.tsx
  • /docs/patterns/{id} · the rule each candlestick shape and chart formation is detected bysrc/app/docs/patterns/[id]/page.tsx
  • /docs/refusals · the research campaign’s selectivity census: the pre-registered bar and the countssrc/app/docs/refusals/page.tsx