Skip to main content
Glama

Audit a backtest

audit_backtest

Audit a strategy's backtest in one call: compute deflated Sharpe, minimum track record length, and overfitting probability directly from a CSV or JSON returns file.

Instructions

Audit one strategy's return series in one call: deflated Sharpe, the minimum track record length for its Sharpe to beat the benchmark, and, with every variant's returns, the probability of backtest overfitting. Point returns_file at the backtest's CSV or JSON rather than copying long series into the call. Each check is the matching validate_ tool's result with its own receipt, side by side; the audit does not grade the strategy. Uses one validation per check. A deflated Sharpe or overfitting probability above or below any threshold is not admission to anything and is not a forecast.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
returnsNoPeriodic returns as fractions (0.01 is 1%), oldest first; replaces the Sharpe, observations, skew and kurtosis fields.
n_splitsNoEven number of blocks, at least 2; default 16.
variantsNoOptional returns of every variant tried, this one included, as fractions: one row per period, one column per variant. Adds the overfitting check.
confidenceNoBetween 0 and 1; default 0.95.
returns_fileNoPath to a CSV or JSON file of the returns on the machine running this server, instead of returns. Not available on the hosted endpoint.
variants_fileNoPath to a CSV or JSON file of every variant's returns (one numeric column per variant), instead of variants.
returns_columnNoHeader name or 1-based position of the returns column when returns_file has several numeric columns.
periods_per_yearYesObservations per year: 252 daily, 365 daily crypto, 52 weekly, 12 monthly.
benchmark_sharpe_annualizedNoAnnualized Sharpe to beat; default 0.
effective_independent_trialsYesIndependent variants tried before choosing this one.
cross_trial_sharpe_sd_annualizedYesStandard deviation of the annualized Sharpe across those trials.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.6.0

TDQS

A4.5/5.0
Behavior5/5

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

Beyond annotations, the description discloses meaningful behavioral details: each check consumes one validation, each check produces its own receipt, the tool does not grade the strategy, and thresholds are not admission or forecasts. This materially changes how an agent should treat the output and complements the sparse annotations.

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

Conciseness5/5

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

The description is dense but every sentence earns its place: outputs, file usage, relationship to validate tools, validation cost, and interpretive caveats are all covered with no redundant phrasing. Key operational information about file usage is front-loaded.

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?

For a tool with 11 parameters breeding a complex audit workflowchers, the description covers the purpose, the checks performed, the file-based input alternative, the receipt behavior, the validation cost, and the non-grading caveat. Since there is no output schema, the description provides enough return-shape information through test coverage of 'each check' and 'own receipt' for an agent to invoke and interpret the tool correctly.

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 most parameter meaning already lives in the input schema. The description adds some practical nuance around returns_file and variants, but it does not add syntax or semantics beyond what the schema already provides. Baseline 3 is appropriate.

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 uses a specific verb ('Audit'), a specific resource ('one strategy's return series'), and enumerates the concrete outputs: deflated Sharpe, minimum track record length, and probability of backtest overfitting. It also distinguishes itself from the validate_* siblings by framing those as individual checks and the audit as their side-by-side combination.

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 description says when to use the tool: to audit one strategy in one call, and it gives operational guidance to point returns_file at a CSV/JSON instead of copying long series. It references the matching validate_ tools and clarifies the audit 'does not grade the strategy,' making the intended alternative relationship inferable, though it does not explicitly say 'use validate_deflated_sharpe when you only need one check.'

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