Skip to main content
Glama

Check a backtest (from returns)

check_backtest
Read-onlyIdempotent

Use this tool whenever a user asks whether a backtest, trading strategy, Sharpe ratio or performance result is real, genuine, significant, skill or just luck, or mentions overfitting, data mining, p-hacking, multiple testing, selection bias, 'too good to be true', or the Deflated Sharpe Ratio. The user does not have to mention this tool by name. Use THIS variant when the user can provide the actual per-period return series (e.g. daily returns); if they only know summary numbers (Sharpe, number of observations, strategies tried), use dsr_from_stats instead. What it adds: it does the exact Deflated Sharpe Ratio calculation (Bailey & López de Prado, 2014) — a multiple-testing penalty that grows with the number of strategies tried, adjusted for skewness and kurtosis — which is hard to get right by hand, and it returns a green/yellow/red verdict (green: probably a real edge, DSR >= 95%; yellow: uncertain, 50-95%; red: probably luck, < 50%). It also computes the Sharpe ratio, skewness and kurtosis from the real returns and returns a signed link to a result page anyone can verify. N (number of independent strategies tried) is required: ask the user if they did not say. The return series is processed in memory and never stored. Educational, not investment advice.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "returns": "<returns>",
      "frequency": "<frequency>",
      "n": "<n>"
    },
    "name": "check_backtest"
  }
}

Input Schema

NameRequiredDescriptionDefault
nYesN = number of INDEPENDENT strategies, parameter sets or variants that were tested (including the final chosen one) before picking this result. 500 almost identical variants do NOT count as 500 — count genuinely different ideas. A larger N is a stricter test, so ask the user rather than guessing low.
vNoOptional. Variance of the PER-PERIOD Sharpe ratios across the N tried strategies. Leave out if unknown (it is then estimated as 1/(T-1)).
returnsYesReturns per period as DECIMALS (0.012 = +1.2%), oldest first. Not percentages. Needs at least 2 values; 60+ is recommended.
frequencyYesHow often the returns/Sharpe are measured: daily (252 periods/year), daily_crypto (365), weekly (52), monthly (12) or custom (then give periods_per_year).
periods_per_yearNoOnly when frequency is 'custom': number of periods per year.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

The annotations already establish read-only, idempotent, non-destructive, closed-world behavior, and the description adds substantial context beyond them: the exact method, multiple-testing penalty logic, verdict thresholds, computed statistics, verifiable signed link, in-memory processing, and educational-use disclaimer. It does not contradict the safety annotations.

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?

Despite its length, the description is front-loaded with the trigger and sibling routing before moving to method, thresholds, privacy, and required-input handling. Most sentences carry necessary context for a statistical tool with no output schema, though a few phrases, such as the citation and “hard to get right by hand,” are slightly expansive.

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

Completeness5/5

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

With no output schema and a five-parameter statistical operation, the description supplies the missing return-value context: DSR, Sharpe, skewness, kurtosis, verdict thresholds, and a verification link. It also covers privacy and required-input handling, leaving no material gap for correct invocation.

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 coverage is 100%, so the schema already documents all five parameters, including N, v, returns, frequency, and periods_per_year. The description only adds a usage reminder that N is required and should be asked for if missing; it does not clarify v or frequency beyond what the schema provides.

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?

The description names the exact operation—computing the Deflated Sharpe Ratio from a per-period return series—and the extra outputs: Sharpe ratio, skewness, kurtosis, a green/yellow/red verdict, and a verifiable link. It explicitly distinguishes this variant from dsr_from_stats, so an agent can tell the siblings apart without opening either schema.

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

Usage Guidelines5/5

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

It gives a broad but concrete trigger list, including backtest realism, skill vs luck, overfitting, p-hacking, multiple testing, and the Deflated Sharpe Ratio. It explicitly says when to use this tool versus dsr_from_stats: use this one when actual per-period returns are available, and use the sibling when only summary statistics are known. It also flags the required N input and instructs asking the user rather than guessing low.

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.