Skip to main content
Glama

crashtestyourstrategy

Backtest integrity check (deflated Sharpe + regime coverage)

backtest_integrity
Read-onlyIdempotent

USE WHEN you have a backtest result (Sharpe, trials tried, window) and want to know whether it is likely overfit. Given an annualized Sharpe, the number of configurations tried and the window (YYYY-MM-DD), returns the DEFLATED Sharpe (the expected maximum Sharpe by chance grows with the trial count: Bailey & Lopez de Prado), which CRISIS regimes the window never contained, and a base-rate caveat. An unknown trial count flags the Sharpe as not-deflatable / UNPROVEN. All inputs optional; give as many as known. Descriptive, not advisory.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "backtest_integrity"
  }
}

Input Schema

NameRequiredDescriptionDefault
kurtNoKurtosis of the strategy's returns (3 = normal).
skewNoSkewness of the strategy's returns (0 = symmetric).
assetNoAsset context for the regime-coverage check (default: SPY as the equity-crisis reference).
n_trialsNoNumber of configurations tried before selecting this backtest — drives the deflated-Sharpe correction. Unknown → the claim is flagged UNPROVEN.
frequencyNoReturn observations per year (252 = daily bars).
backtest_endNoBacktest window end (YYYY-MM-DD).
backtest_startNoBacktest window start (YYYY-MM-DD) — used to detect crisis regimes the window never contained.
annualized_sharpeNoThe claimed annualized Sharpe ratio of the backtest.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / additionalProperties
      Added value: +false
  2. Changed8 schema fields changed
    • addedInput schema / properties / annualized_sharpe / description
      Added value: +"The claimed annualized Sharpe ratio of the backtest."
    • addedInput schema / properties / asset / description
      Added value: +"Asset context for the regime-coverage check (default: SPY as the equity-crisis reference)."
    • addedInput schema / properties / backtest_end / description
      Added value: +"Backtest window end (YYYY-MM-DD)."
    • addedInput schema / properties / backtest_start / description
      Added value: +"Backtest window start (YYYY-MM-DD) — used to detect crisis regimes the window never contained."
    • addedInput schema / properties / frequency / description
      Added value: +"Return observations per year (252 = daily bars)."
    • addedInput schema / properties / kurt / description
      Added value: +"Kurtosis of the strategy's returns (3 = normal)."
    • addedInput schema / properties / n_trials / description
      Added value: +"Number of configurations tried before selecting this backtest — drives the deflated-Sharpe correction. Unknown → the claim is flagged UNPROVEN."
    • addedInput schema / properties / skew / description
      Added value: +"Skewness of the strategy's returns (0 = symmetric)."
  3. First observed

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnly/idempotent/non-destructive, so the bar is lower, and the description still adds real behavior: the deflation model and why trial count matters, the UNPROVEN flag when n_trials is unknown, and the deliberate 'descriptive, not advisory' framing. It does not describe output shape or edge behavior when the Sharpe itself is omitted.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the trigger condition, then mechanics, then the caveat disclaimer; every sentence carries information. Slightly dense with stacked clauses and a citation parenthetical, but nothing is wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need only light explanation, and the description still names the three outputs and the UNPROVEN flag. For a computation tool with all-optional inputs, the only gap is what happens when no Sharpe is supplied at all.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3; the schema already explains kurt, skew, frequency, asset, and the window fields. The description adds conceptual grounding for n_trials (expected max Sharpe grows with trials) and restates the UNPROVEN rule, but says nothing about four of the eight parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific computation (deflated Sharpe) plus two secondary outputs (crisis regimes the window never contained, a base-rate caveat), so the agent knows exactly what comes back. The closing 'Descriptive, not advisory' distinguishes it from advisory/judgment siblings without needing to name them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The opening 'USE WHEN you have a backtest result (Sharpe, trials tried, window) and want to know whether it is likely overfit' gives a clear trigger condition. No explicit alternatives or when-not conditions are named (e.g. versus a stress-test or strategy-challenge tool), so it falls short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.