Skip to main content
Glama
tedorigawa001

TradingView-MCP

run_backtest

Backtest a saved TradingView strategy on the active chart's symbol and timeframe, get the report, then remove the strategy so the chart stays unchanged; keep it on the chart when needed.

Instructions

Backtest one of the user's OWN saved strategies on the active chart's current symbol and timeframe: temporarily applies the strategy, waits for the Strategy Tester report, returns it (same shape as get_strategy_report) and removes the strategy again so the chart is left unchanged (set keep_on_chart to keep it). Get strategy pine_ids (kind 'strategy') from list_pine_scripts. Combine with set_symbol/set_timeframe to test other markets.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pine_idYesStrategy script id from list_pine_scripts, e.g. 'USER;71f1e4e6807c4bb48bd55edb886908a0'
trades_limitNoMax most-recent trades to include. Default: 20
keep_on_chartNoLeave the strategy on the chart after the test. Default: false (auto-remove)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.10

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and does so well. It discloses that the strategy is temporarily applied, that the tool waits for the Strategy Tester report, that the report has the same shape as get_strategy_report, that the strategy is removed afterward to leave the chart unchanged, and that keep_on_chart overrides cleanup.

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 dense yet efficient: the first sentence covers action, scope, workflow, return shape, and cleanup; the second covers the prerequisite; the third covers companion tools. Every sentence earns its place with no repetition or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given there is no output schema, referencing get_strategy_report's shape is valuable and sufficient. The description also covers prerequisites (list_pine_scripts), optional persistence (keep_on_chart), cleanup behavior, and how to extend to other symbols/timeframes. Nothing critical for calling the tool correctly is missing.

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 100%, so the schema documents all three parameters, including the pine_id format and trades_limit bounds. The description reinforces keep_on_chart's meaning and the source of pine_id, adding modest context, but it does not substantially extend parameter semantics beyond the 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?

States a specific action ('Backtest'), a specific resource ('the user's OWN saved strategies'), and a precise scope ('active chart's current symbol and timeframe'). It also references get_strategy_report's shape, which helps the agent understand what this tool produces and how it relates to a sibling.

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?

Gives explicit guidance on where to get valid strategy IDs ('Get strategy pine_ids ... from list_pine_scripts') and how to test other markets ('Combine with set_symbol/set_timeframe'). It does not explicitly contrast this tool with run_backtest_matrix or run_strategy_walk_forward, but it provides clear context for the common workflow.

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