Skip to main content
Glama

Strategy Backtest

backtest_strategy
Read-only

Backtest a trading strategy on historical data with institutional-grade metrics.

Args:
    symbol: Yahoo Finance symbol (AAPL, BTC-USD, THYAO.IS, ^GSPC)
    strategy: rsi | bollinger | macd | ema_cross | supertrend | donchian
              | rsi_pullback | keltner_breakout | triple_ema
              (rsi_pullback and triple_ema need period >= '1y' for SMA200 warmup)
    period: '1mo', '3mo', '6mo', '1y', '2y'
    initial_capital: Starting capital in USD (default $10,000)
    commission_pct: Per-trade commission % (default 0.1%)
    slippage_pct: Per-trade slippage % (default 0.05%)
    interval: '1d' (daily) or '1h' (hourly)
    include_trade_log: Include full per-trade log (default False)
    include_equity_curve: Include equity curve data points (default False)

Input Schema

NameRequiredDescriptionDefault
periodNo1y
symbolYes
intervalNo1d
strategyYes
slippage_pctNo
commission_pctNo
initial_capitalNo
include_trade_logNo
include_equity_curveNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, openWorldHint=true and destructiveHint=false, so the safety profile is covered. The description adds real behavioral context beyond that: the SMA200 warmup constraint for two strategies and the fact that trade log and equity curve payloads are opt-in (default False). It does not disclose cost/rate behavior or what 'institutional-grade metrics' actually contains.

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?

The one-sentence purpose is front-loaded before the structured Args block, and every arg line earns its place by adding format or default detail absent from the schema. It is on the long side, and the defaults duplicated from the schema could be trimmed, but there is little waste.

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 9 parameters and no output schema, the description covers inputs thoroughly but leaves the return shape vague ('institutional-grade metrics') and gives no guidance on selecting this versus compare_strategies or walk_forward_backtest_strategy. Adequate for invocation, thin for deciding whether this is the right backtest tool.

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 description coverage is 0%, so the description carries the full burden, and it delivers: symbol format examples (AAPL, BTC-USD, THYAO.IS, ^GSPC), the full strategy list, allowed period and interval values, and the unit/meaning of each numeric default (USD capital, per-trade commission %, slippage %). Enum-like allowed values are supplied nowhere else, so this is essential compensation.

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 specific verb and resource ('Backtest a trading strategy on historical data') plus an output quality signal ('institutional-grade metrics'). An agent can tell it apart from adjacent tools like backtest_chart or simple scanners, but the description never explicitly contrasts itself with siblings such as compare_strategies or walk_forward_backtest_strategy.

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

Usage Guidelines3/5

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

Usage is implied rather than stated: the reader infers this is the single-strategy backtest tool, but there is no explicit when-to-use/when-not, and no routing to siblings like compare_strategies or walk_forward_backtest_strategy. One genuine conditional is provided (rsi_pullback and triple_ema require period >= '1y'), which is a concrete usage constraint.

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.