Skip to main content
Glama

Run backtest

run_backtest
Idempotent

Answers 'would this strategy have worked - without look-ahead or survivorship bias?' Give a JSON spec (universe as a symbol list or top500/top1000/top3000/all, start, end, signal, rebalance D/W/M/Q, top_n, costs_bps, side long or long_short, blind=true to hide tickers). Signals: momentum, ma_cross, factor, or expr formulas over prices and point-in-time fundamentals (from 2011), e.g. 'rank(ret(252)) - rank(vol(60))'. Returns stats, benchmark stats, equity curve, warnings, snapshot id, an overfitting report (trials counted, deflated Sharpe) and a disclaimer. Prices are point-in-time with a 400-day buffer, clipped to as_of; identical specs on the same snapshot are cached and free. Free keys backtest the last 12 months; full history with a FinzData plan.

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
specYesBacktest spec.
as_ofNoPoint-in-time cutoff (YYYY-MM-DD). Nothing dated after this is returned, preventing look-ahead bias. Defaults to today (UTC).
dry_runNotrue: check the spec and report what would run and what it would cost, without running it or charging. Default false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / dry_run
      Added value: +{
      +  "description": "true: check the spec and report what would run and what it would cost, without running it or charging. Default false.",
      +  "type": "boolean"
      +}
  2. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only declare idempotent, non-destructive, non-read-only hints; the description goes far beyond that by disclosing point-in-time price handling with a 400-day buffer, clipping to as_of, caching semantics, trial counting and deflated Sharpe for overfitting, and a disclaimer. Budget/entitlement constraints (free tier vs. paid plan) are exactly the kind of behavior an agent cannot get from 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?

Front-loaded with the value proposition, then inputs, then signal options, then return shape, then pricing constraints — a logical progression. It is dense and packed into long sentences, but nearly every clause carries actionable information; only the formula example and output enumeration verge on over-packing.

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?

No output schema exists, so the description carries the return-value burden and does so explicitly (stats, benchmark stats, equity curve, warnings, snapshot id, overfitting report, disclaimer). Combined with universe/signal/rebalance syntax, pricing limits, and as_of/dry_run behavior from the schema, an agent has enough to call this correctly on the first attempt.

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

Parameters5/5

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

Schema coverage is nominally 100%, but the critical 'spec' parameter is an opaque nested object documented only as 'Backtest spec.' The description compensates by enumerating the spec's fields (universe forms, start, end, signal, rebalance D/W/M/Q, top_n, costs_bps, side, blind) and giving a formula example, which is substantial meaning beyond the schema.

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?

Opens with a concrete framing ('would this strategy have worked - without look-ahead or survivorship bias?') and names the exact input (a JSON spec) and output surface (stats, equity curve, overfitting report, snapshot id). It is clearly a simulation tool, distinguishable from mutating/CRUD siblings like register_strategy or list_strategies.

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 strong operational context: free keys are limited to the last 12 months, full history needs a FinzData plan, and repeated identical specs on the same snapshot are cached and free. It does not explicitly name alternatives such as run_strategy or compare_runs, so the agent must infer when to choose this over a live strategy run.

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.