Skip to main content
Glama

backtest

Evaluate trading strategies by running backtests with natural language or structured rules, supporting walk-forward validation and risk-based position sizing.

Instructions

Run a backtest on a trading strategy using natural language or structured rules.

Args: strategy: Strategy description (e.g. "Buy when RSI(14) < 30, sell when RSI(14) > 70") or JSON structured format {"entries":[...],"exits":[...]} universe: List of tickers (e.g. ["AAPL", "MSFT"]) or preset ("SP500", "MAGNIFICENT7"). Defaults to MAGNIFICENT7. period_start: Start date YYYY-MM-DD (default: 3 years ago) period_end: End date YYYY-MM-DD (default: today) capital: Starting capital (default: 100000) benchmark: Benchmark ticker (default: SPY) walk_forward: Enable walk-forward validation to detect overfitting position_sizing: "equal", "risk_parity", "vol_target", or "kelly" allow_short: Allow short selling

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
strategyYes
universeNo
period_startNo
period_endNo
capitalNo
benchmarkNoSPY
walk_forwardNo
position_sizingNoequal
allow_shortNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

No annotations are provided, so the description must carry the full burden. It lists parameters but does not disclose what happens during execution (e.g., data source, performance, side effects). The existence of an output schema may cover return values, but the description omits any behavioral context beyond inputs.

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 description is well-structured with an Args list and examples. It is fairly concise, though could be slightly more terse. Overall, each sentence adds value without excessive verbosity.

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?

For a complex tool with 9 parameters and no annotations, the description covers all parameters and their defaults. It explains the purpose and key options. However, it does not mention output or data sources, but the presence of an output schema partially compensates.

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 is the sole source for parameter meaning. It explains each parameter in detail, including examples for 'strategy', presets for 'universe', date formats, defaults, and special options like 'walk_forward'. This adds significant value beyond the bare 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?

The description clearly states it runs a backtest on a trading strategy. The verb 'Run a backtest' is specific, and the mention of natural language or structured rules distinguishes it from sibling tools like 'batch_backtest' or 'optimize_portfolio'.

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?

The description explains when to use the tool (for backtesting a single strategy) but does not explicitly state when not to use it or mention alternatives such as 'batch_backtest' for multiple strategies. The usage context is clear but lacks exclusion guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/beee003/vynn-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server