Skip to main content
Glama

Quant Swarm Audit — Inline Backtest Forensics (Remote Safe)

audit.backtest_inline
Read-onlyIdempotent

Run a one-shot forensic backtest audit on inline CSV or row arrays with no server disk I/O; validate Newey-West significance, cost survival, concentration, and PIT leakage up to 250 KB.

Instructions

Runs a one-shot backtest forensic audit over inline CSV or row arrays with zero server disk I/O.

Built for remote HTTP connectors (claude.ai, ChatGPT, web MCP): evaluates Newey-West HAC significance, BH q-value, cost survival, concentration, and PIT leakage up to 250 KB.

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_inline"
  }
}

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 (ts,symbol,pnl_bps,position_pct; max 250 KB).
returns_csvNoInline UTF-8 CSV string of strategy returns (columns: ts,strategy_return; max 250 KB).
trades_rowsNoOptional inline trade records [{ts, symbol, pnl_bps, position_pct}].
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 (max 250 KB).
strategy_nameNoHuman-readable strategy identifier.candidate_strategy
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.8/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, non-destructive and closed-world, so the description's real contribution is disclosing what the audit actually computes: Newey-West HAC significance, BH q-value, cost survival, concentration and PIT leakage, plus the "one-shot" and 250 KB constraints. It doesn't say how oversized or insufficient payloads are handled (truncate, error, or degrade), which is the one behavioral detail an agent would still want.

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?

Two sentences, front-loaded with the core action and the differentiator; no filler or restatement of the title. "One-shot" and "forensic audit" lean on jargon whose precise meaning is never unpacked, and the mid-sentence line breaks slightly hurt scannability.

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?

With an output schema present and full parameter coverage, most burden is lifted, but 14 optional parameters and zero required fields leave a real gap: nothing says the minimum viable call or the relationship between trades_csv/trades_rows and returns_csv/returns_rows (presumably at least one input pair must be supplied). An agent can read the parameters but still has to guess whether a call with only defaults is valid.

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 14 parameters already carries its own documentation, including column shapes and units. The description only echoes the CSV/row-array duality and the size cap, adding no semantics beyond what the schema states.

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?

States a concrete verb+resource ("Runs a one-shot backtest forensic audit") and pins down the data channel ("inline CSV or row arrays with zero server disk I/O"), which is exactly what separates it from a path-based sibling like audit.backtest. It never names that alternative explicitly, so the differentiation is inferable rather than stated.

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?

Gives a clear when-to-use context — remote HTTP connectors such as claude.ai, ChatGPT, web MCP — plus the hard 250 KB payload ceiling that tells the agent when this route is viable. It stops short of an explicit exclusion telling the agent to use the disk-based sibling when the data already lives on the server, leaving that inverse to inference.

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