Skip to main content
Glama

Backtest Vault

Run a backtest

run_backtest
Idempotent

What it does: runs one strategy spec against 15+ years of real 1-minute futures history (NQ by default; set spec.instrument to ES or GC) with realistic fills, slippage and commission, and saves the run to the user's private vault. Returns: run_id, metrics (trades, win rate, profit factor, net P&L in dollars, max drawdown, Sharpe, exit breakdown), an equity curve of at most 500 points, a monthly table, credits charged and credits left. A rejected spec returns a teaching error naming the exact path and the valid options: fix the spec and call again. When to use: whenever the user wants numbers for an idea; compose the spec from get_spec's grammar and never estimate results yourself. Costs 1 credit (2 on 1-minute bars); an identical re-run on the same data is a free cache hit. Never returns price bars.

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": {
      "spec": "<spec>"
    },
    "name": "run_backtest"
  }
}

Input Schema

NameRequiredDescriptionDefault
specYesThe full strategy spec object, per get_spec's grammar

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, idempotentHint=true and destructiveHint=false, so the safety profile is partly covered, but the description adds substantial context the annotations do not: it costs 1 credit (2 on 1-minute bars), identical re-runs are free cache hits, the run is saved to the private vault, and rejected specs return a teaching error naming the exact path and valid options. That cost, persistence and failure-mode disclosure is genuinely valuable beyond the structured fields.

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 a labelled 'What it does', followed by returns, then 'When to use', which is easy for an agent to scan. It is slightly long and the returns inventory is dense, but each section carries information an agent needs, and the critical cost and error semantics are stated plainly rather than buried.

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, the description compensates by enumerating the return payload (run_id, metrics, equity curve capped at 500 points, monthly table, credits charged and left) and by spelling out the failure path for a rejected spec. For a single-parameter, credits-consuming run tool, nothing an agent needs to call it correctly appears to be missing.

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

Parameters4/5

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

Only one parameter and schema description coverage is 100%, so the baseline is 3, but the description adds real meaning: spec.instrument defaults to NQ and accepts ES or GC, and the spec should be built from get_spec's grammar rather than guessed. That goes beyond the schema's terse 'per get_spec's grammar' note.

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 verb (runs a backtest) plus the exact resource: one strategy spec against 15+ years of 1-minute futures history with realistic fills, slippage and commission, persisted to the user's private vault. It also names the default instrument (NQ) and the alternatives (ES, GC), so an agent can distinguish it from siblings like rerun or compare_runs at a glance.

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?

Explicitly says when to use it ('whenever the user wants numbers for an idea') and gives the dependency that must precede it: compose the spec from get_spec's grammar and never estimate results yourself. It also flags that an identical re-run on the same data is a free cache hit, nudging away from redundant calls, though it never states a when-not condition or names rerun as the explicit alternative.

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.

Resources