Skip to main content
Glama
PantherWatch

panther-mcp

Official
by PantherWatch

tool_run_backtest

Execute a trading-strategy backtest by defining entry/exit rules, indicators, and risk settings; returns a backtest ID to retrieve performance results.

Instructions

Define and execute a trading strategy backtest.

The strategy object must include:

  • name: Strategy name

  • direction (optional): "long" (default), "short", or "both"

    • "long": entry_rules trigger buys, exit_rules trigger sells

    • "short": entry_rules trigger short entries, exit_rules trigger short covers

    • "both": uses entry_rules/exit_rules for longs, plus short_entry_rules/short_exit_rules for shorts

  • entry_rules: List of rules that trigger entry

  • exit_rules: List of rules that trigger exit

  • short_entry_rules (required when direction="both"): Rules for short entries

  • short_exit_rules (required when direction="both"): Rules for short exits

  • stop_loss (optional): Stop loss as fraction (0.05 = 5%)

  • take_profit (optional): Take profit as fraction (0.15 = 15%)

Each rule has:

  • indicator: SMA, EMA, RSI, MACD, or BB

  • params: Indicator parameters (e.g. {"period": 50})

  • condition: crosses_above, crosses_below, greater_than, less_than, equals

  • compare_to: Another indicator object or a numeric value

Returns a backtest_id. Use get_backtest_status to poll for completion, then get_backtest_results for the full results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYes
end_dateNo
strategyYes
timeframeYes
commissionNo
start_dateYes
initial_cashNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations provided, the description carries the full behavioral disclosure burden. It transparently reveals the asynchronous execution model: the tool returns only a backtest_id and requires polling. It also explains direction-specific rule semantics, which is important behavioral context beyond the bare schema.

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?

The description is well-organized with bullets, clear sections, and meaningful examples such as '0.05 = 5%'. Every sentence contributes useful information, and the structure makes a complex nested input digestible without unnecessary fluff.

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 nested objects and an asynchronous workflow, the description covers strategy construction, direction variants, rule definitions, and the follow-up polling sequence. It leaves some gaps around scalar parameter formats and potential error cases, but it is broadly complete enough for an agent to invoke the tool correctly.

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 0%, so the description must compensate. It does thoroughly for the strategy object, detailing all subfields and rule syntax. However, top-level parameters like symbol, timeframe, start_date, end_date, commission, и initial_cash are left unexplained, forcing the agent to infer format and meaning.

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 opens with a specific action ('Define and execute a trading strategy backtest') and identifies the tool's place in the workflow by stating it returns a backtest_id that is later used with status and result tools. This clearly distinguishes it from siblings like get_backtest_status and get_backtest_results.

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 provides explicit follow-up guidance: poll with get_backtest_status, then retrieve results with get_backtest_results. It does not explicitly contrast against optimize_strategy or portfolio backtest tools, but the described workflow makes the primary use case unambiguous.

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

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/PantherWatch/panther-mcp'

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