Skip to main content
Glama

Run a backtest

run_strategy_backtest
DestructiveIdempotent

Start a backtest of a strategy the client built, and return its key at once.

Writes: the backtest publishes the strategy's holdings and transaction ledger.
Takes a minute or two; returns a ``key`` and an ETA, and ``get_backtest_status(key)``
(free) follows it. Each run spends the backtest allowance, except that the same
definition on the same day reuses the earlier run. The window is the history the
strategy was built with, 5 years by default; ``history_years`` first moves the
strategy's start (back to 2006 at most) and backtests over the new window,
leaving the definition as it is. For a strategy already backtested,
``describe_portfolio_series`` reads the result.

A strategy on a fixed list (``asset_ids``) holds that list through its whole
history, so a list picked today, from a screen or from today's holdings, has
hindsight bias in its backtest; a screened strategy picks its names as of each date.

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": {
      "strategy_id": "<strategy_id>"
    },
    "name": "run_strategy_backtest"
  }
}

Input Schema

NameRequiredDescriptionDefault
strategy_idYes
history_yearsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the annotations (destructiveHint=true, idempotentHint=true), the description explains exactly what the write produces ('publishes the strategy's holdings and transaction ledger'), the latency ('a minute or two'), the cost (backtest allowance), the deduplication rule (same definition on same day reuses), and the history-window semantics. This is the kind of context annotations cannot carry.

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 action and return value, then cost, then polling, then window semantics. Dense but nearly every sentence carries operational information; the closing hindsight-bias paragraph is useful caveat material though only indirectly about calling this tool (asset_ids is not a parameter here).

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

Completeness4/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 does the necessary work by naming the return values (key, ETA) and the follow-up tool. It does not cover failure modes such as what happens when the allowance is exhausted, which is the main remaining gap for a costly mutation.

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?

Schema coverage is reported as 0% at the property level, and the description compensates: history_years is explained as moving the strategy's start (back to 2006 at most), rebuilding history over a new window, and leaving the definition unchanged, with the 5-year default restated. strategy_id is left implicit, but its meaning is unambiguous from the tool name.

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 and resource ('Start a backtest of a strategy') and immediately gives the return shape ('return its key at once'). It is distinguishable from get_backtest_status (polling) and describe_portfolio_series (reading existing results), both of which it names.

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

Usage Guidelines5/5

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

Explicit routing: get_backtest_status follows a run, describe_portfolio_series reads results for a strategy already backtested. It also gives the when-not logic implicitly via cost ('each run spends the backtest allowance') and the same-day reuse exception, so an agent knows when a call is free and when it is not.

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