Skip to main content
Glama

Quant Swarm Audit — One-Shot Backtest Forensics

audit.backtest
Read-onlyIdempotent

Run a zero-trust backtest forensic audit in one call to detect lookahead leakage, weak significance, cost fragility, drawdown tails, and trade concentration before promotion.

Instructions

Runs a complete zero-trust backtest forensic audit in a single call at 0 credits.

Evaluates lookahead leakage, Newey-West HAC t-stat, Benjamini-Hochberg q-value, Deflated Sharpe, 1x/2x cost survival, drawdown tails, and top-5 trade concentration locally.

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": "audit.backtest"
  }
}

Input Schema

NameRequiredDescriptionDefault
num_trialsNoNumber of strategy/parameter trials tested for BH q-value and Deflated Sharpe adjustment.
spread_bpsNoOptional one-way spread override in bps.
trades_csvNoOptional inline UTF-8 CSV string of trade records (<=250 KB).
returns_csvNoInline UTF-8 CSV string of strategy returns (ts,strategy_return; <=250 KB).
trades_pathNoOptional workspace-bounded path to trade records CSV/Parquet/JSON (stdio only).
trades_rowsNoOptional inline trade records [{ts, symbol, pnl_bps, position_pct}].
returns_pathNoWorkspace-bounded path to CSV/Parquet/JSON strategy returns (stdio only).
returns_rowsNoInline list of strategy return rows [{ts, strategy_return}].
slippage_bpsNoOptional one-way slippage override in bps.
benchmark_csvNoOptional inline UTF-8 CSV string of benchmark returns (<=250 KB).
strategy_nameNoHuman-readable strategy identifier.candidate_strategy
benchmark_pathNoOptional workspace-bounded path to benchmark returns (stdio only).
benchmark_rowsNoOptional inline benchmark return rows [{ts, return}].
commission_bpsNoOptional one-way commission override in bps.
cost_assumptionsNoOptional execution cost assumptions {spread_bps, slippage_bps, adverse_selection_bps, commission_bps}.
features_manifestNoOptional point-in-time feature manifest {as_of, features: [...]}.
adverse_selection_bpsNoOptional one-way adverse selection override in bps.

Output Schema

NameRequiredDescriptionDefault
howNo
modeNo
toolNo
errorNo
accessNo
job_idNo
reasonNo
statusNo
metricsNo
eligibleNo
findingsNo
gbp_costNo
job_id_aNo
job_id_bNo
next_stepNo
strategy_aNo
strategy_bNo
html_reportNo
max_creditsNo
credits_costNo
generated_atNo
input_sha256No
metrics_diffNo
new_warningsNo
preflight_idNo
random_seedsNo
has_benchmarkNo
strategy_nameNo
written_filesNo
approval_tokenNo
execution_planNo
input_sha256_aNo
input_sha256_bNo
trades_summaryNo
artifact_hashesNo
coverage_matrixNo
credits_chargedNo
idempotency_keyNo
markdown_reportNo
package_versionNo
returns_summaryNo
assessment_afterNo
cost_assumptionsNo
headline_metricsNo
not_tested_countNo
required_creditsNo
assessment_beforeNo
idempotent_replayNo
request_access_atNo
resolved_findingsNo
validation_errorsNo
counts_by_categoryNo
overall_assessmentNo
finding_transitionsNo
remediation_verdictNo
has_features_manifestNo
not_investment_adviceNo
outbound_data_previewNo
reproducibility_bundleNo
estimated_runtime_secondsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.2.1

TDQS

A3.5/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), so the bar is lower. The description nonetheless adds genuinely useful context beyond them: zero credit cost and local execution, which tells the agent no data leaves the host and no billing is incurred. It omits practical frictions documented only in the schema, such as the 250 KB inline payload cap and stdio-only path access.

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?

Two sentences, zero filler, and the core purpose plus cost is front-loaded before the metric list. The enumerated statistics are dense but each one is load-bearing, telling the agent what evidence the audit returns.

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

Completeness3/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-value explanation is unnecessary, and annotations cover safety. However, with 17 optional parameters and zero required ones, the agent critically needs to know which input combinations are valid (trades vs returns vs benchmark, inline vs rows vs path) and what makes the audit fail — none of which the description addresses.

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 every one of the 17 parameters is already documented in the schema, making 3 the baseline. The description adds no parameter-level meaning at all — it never explains the trades-vs-returns input paths, the cost override precedence, or that num_trials drives the BH/Deflated Sharpe adjustment.

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

Purpose4/5

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

The description states a specific verb and resource ('Runs a complete zero-trust backtest forensic audit') and enumerates the exact statistics computed, so the agent knows precisely what comes back. It signals differentiation via 'in a single call' and 'locally', but never names or contrasts with the obvious sibling audit.backtest_inline, which also appears to accept inline data — that ambiguity keeps it from a 5.

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

Usage Guidelines2/5

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

There is no explicit when-to-use, when-not-to-use, or alternative routing. 'In a single call' implies this is the all-in-one variant versus a staged workflow (audit.preflight → audit.run → audit.report), but the agent must infer that, and nothing explains when audit.backtest_inline or audit.run is the better choice.

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