Skip to main content
Glama
mt5-mcp

mt5-mcp

by ramanthind02

run_backtest

Run a headless MetaTrader 5 Strategy Tester backtest from a tester INI, wait for terminal exit, and capture the configured report path for review.

Instructions

Run terminal64.exe /config on a tester ini and wait until it exits.

The ini must contain only [Tester] and [TesterInputs], with ShutdownTerminal=1. The launch path is used as written. A junction, an already-open terminal, or the same program running from another path is refused. The report is the file named by Report in the ini. Before the launch, the EA sources and the ini are copied into a snapshot. The manifest is updated with the report path.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "config": "<config>"
    },
    "name": "run_backtest"
  }
}

Input Schema

NameRequiredDescriptionDefault
configYes
timeout_secNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior5/5

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

Annotations only give the generic readOnly/openWorld/destructive hints; the description adds the real behavioral profile: the call blocks until the process exits, EA sources and the ini are snapshotted before launch, the manifest is mutated with the report path, and specific pre-launch states cause refusal. Those side effects are exactly what an agent needs before committing to a long-running, state-mutating operation.

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?

Sentences are short and every one carries information (mechanism, ini constraints, refusal conditions, report location, snapshot, manifest). The style is telegraphic and slightly disjointed — the snapshot/manifest lines arrive after the report line — but nothing is filler.

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 no output schema, the description should say what comes back; it only states that the report is a file named by the ini and that the manifest gets the path, without saying whether the tool returns that path, an exit code, or nothing. The unaddressed timeout behavior is the other substantive gap for a long-running, blocking tool.

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 coverage is 0%, so the description carries the burden. It compensates well for `config`, spelling out the required ini sections, ShutdownTerminal=1, and that the report path comes from Report inside that file. But `timeout_sec` (default 1800) is never mentioned — the description says only 'wait until it exits', leaving unclear whether a timeout aborts the run or kills the terminal.

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 first sentence names the exact mechanism (terminal64.exe /config on a tester ini) and the exact semantics (block until exit), which separates it from launch_terminal (fire-and-forget) and smoke_test (lighter validation). An agent can tell what this does and roughly where it sits in the lifecycle 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?

Preconditions are stated concretely: the ini must contain only [Tester] and [TesterInputs] with ShutdownTerminal=1, and the call is refused for junctions, an already-open terminal, or a conflicting path. What is missing is routing guidance relative to siblings — it never says to build the ini with write_tester_config first, or when to prefer smoke_test over a full backtest.

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