Skip to main content
Glama

Basis

backtest_run

Read-onlyIdempotent

Backtest one built-in strategy with one set of parameters. Fills happen at the next bar's open and costs are charged per side. Returns risk-adjusted metrics alongside the raw return — judge on those, not on total return.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNoReuse a handle from market_candles instead of loading.
feeBpsNoPer side. Default 4.
marketNoDefault: the chart.
paramsNo
symbolNoDefault: the chart.
exchangeNo
directionNo
timeframeNoe.g. 1h, 4h. Default: the chart.
strategyIdYes
maxBarsHeldNoOptional time stop in bars.
slippageBpsNoDefault 1.
stopLossPercentNoOptional protective stop percentage.
takeProfitPercentNoOptional profit target percentage.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

The annotations already cover the safety profile (readOnlyHint=true, idempotentHint=true, destructiveHint=false). The description adds genuinely valuable behavior beyond those: fill timing ('next bar's open') and cost modeling ('costs are charged per side'), plus a critical evaluation caveat about not judging on total return. No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, zero waste. The core purpose is front-loaded, the execution model follows, and the evaluation guidance closes. Every sentence earns its place and there is no redundancy with the schema or annotations.

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 13 parameters, a nested params object, and no output schema, the description covers the most agent-critical facts: scope, execution model, and how to interpret the return value ('risk-adjusted metrics alongside the raw return'). Remaining gaps — how the nested params object is structured, where valid strategyIds come from, and the context-dependent 'default: the chart' behavior — are not addressed, but the description's emphasis on evaluation criteria is the highest-value missing piece for correctness.

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

Parameters3/5

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

Schema description coverage is 69%, so the schema already documents most parameters and the description need not repeat them. The description does add meaning tying to parameters — 'charged per side' clarifies feeBps semantics, and 'one set of parameters' scopes the nested params object. But it doesn't explain how the params object maps to strategy inputs or clarify the relationship among ref, exchange, and symbol, so it only partially compensates for the uncovered 31%.

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 states a specific verb ('backtest') and resource ('one built-in strategy'), with a scope qualifier ('one set of parameters'). This clearly distinguishes the tool from siblings like screener_backtest (which presumably backtests screener results across many strategies) and strategy_research. An agent can tell what this tool does without opening the schema.

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?

The scoping language 'one built-in strategy with one set of parameters' gives clear context for when to invoke this tool, and the instruction to 'judge on risk-adjusted metrics, not on total return' is actionable usage guidance. However, it never names an alternative explicitly (e.g., screener_backtest) or states exclusions, so it stops short of full routing guidance.

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