Skip to main content
Glama

Run a backtest

run_backtest

Run a strategy against real historical data and return its performance. Nothing is saved or published unless save is set — a backtest is a question, not a publication. Call get_strategy_spec_rules first if you have not already. If exactly this — same rules, settings and period, over months that have finished — was saved before (by this account, or publicly), that result comes back and no backtest is used.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
saveNoPersist the run. Omit for a throwaway backtest.
specYesThe strategy spec object — see get_strategy_spec_rules
paramsNoOverride declared params for this run

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations only say readOnlyHint=false and destructiveHint=false; the description adds real value by disclosing that nothing is persisted or published unless `save` is provided, and that identical previously-saved runs (private or public) are returned from cache instead of re-executed. That caching/dedup behavior is not derivable from annotations or schema.

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?

Three sentences, front-loaded with the core action before the prerequisite and caching caveat. The 'a backtest is a question, not a publication' line is rhetorical but does compactly convey the side-effect-free default.

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?

Given a nested-object schema, no output schema, and modest annotations, the description covers the key agent-facing questions: prerequisite call, persistence semantics, and cache-hit behavior. Return values are only characterized as 'performance', which is acceptable without an output schema but leaves result shape unspecified.

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 100%, so the baseline is 3, and the description goes beyond it by tying `save` to persistence/publication and spelling out the identity key for cache hits (same rules, settings, period, completed months). It doesn't elaborate on `params` overrides or the nested visibility/strategyId fields, which the schema handles.

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 ('Run a strategy against real historical data and return its performance'), which is clearly distinguishable from retrieval siblings like get_run or get_trades. It does not explicitly name the nearest alternative (run_portfolio), so it stops short of full sibling differentiation.

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?

It gives a concrete prerequisite ('Call get_strategy_spec_rules first if you have not already') and explains the cached-result condition that bypasses execution entirely. There is no explicit 'do not use this when...' routing to run_portfolio or optimize_strategy, but the operational context is clear.

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