Skip to content

MCP Tool Reference

Grouped reference of the tradingview-mcp tools. The MCP server exposes 78 tools total. This page organizes them by category and marks which ones are used by the strategy interpretation layer.

Tools marked with [STRATEGY] are called by the strategy layer during scans. All other tools are available for manual use, debugging, or future automation.


Health

System-level tools for verifying connectivity and inspecting TradingView state.

Tool Description Strategy Use
tv_health_check Check CDP connection to TradingView Desktop [STRATEGY] -- called at startup and on reconnect
tv_discover List all available TradingView windows/tabs Debugging
tv_ui_state Get current UI state (dialogs, panels, menus) Debugging
tv_launch Launch TradingView Desktop with specified flags Setup

Chart Control

Tools for reading and modifying chart state. The strategy layer uses read-only chart tools.

Tool Description Strategy Use
chart_get_state Get full chart state (symbol, timeframe, indicators) [STRATEGY] -- reads symbol and timeframe for flags
chart_set_symbol Change the chart's symbol Not used (read-only)
chart_set_timeframe Change the chart's timeframe Not used (read-only)
chart_set_type Change chart type (candle, bar, line) Not used
chart_manage_indicator Add, remove, or configure indicators Not used (read-only)
chart_get_visible_range Get the visible time range on the chart Debugging
chart_set_visible_range Set the visible time range Not used
chart_scroll_to_date Scroll chart to a specific date Not used
symbol_info Get symbol metadata (tick size, session times) Future: tick value for risk calc
symbol_search Search for symbols by name Not used

Data Access

Tools for reading chart data, indicator output, and market quotes. This is the primary category for the strategy layer.

OHLCV and Quotes

Tool Description Strategy Use
data_get_ohlcv Get OHLCV candle data from visible chart Future: price context
quote_get Get current quote (bid, ask, last) Future: real-time price
depth_get Get order book / market depth Not used

Indicator Data (Generic)

Tool Description Strategy Use
data_get_indicator Get indicator plot values Not used (Pine graphics preferred)
data_get_study_values Get study output values by name Not used
data_get_strategy_results Get Pine strategy backtest results Not used
data_get_trades Get strategy trade list Not used
data_get_equity Get strategy equity curve Not used

Pine Graphics (Core Strategy Tools)

These four tools are the primary data source for the strategy layer. They read Pine Script graphics objects rendered by indicators on the chart.

Tool Description Strategy Use
data_get_pine_labels Read Pine label objects (text, price, position) [STRATEGY] -- reads Bias AI labels, Session Hunt AI labels, SMT labels
data_get_pine_lines Read Pine line objects (horizontal levels, trend lines) [STRATEGY] -- reads Session Hunt AI range lines, OB AI boundary lines
data_get_pine_tables Read Pine table objects (structured text grids) [STRATEGY] -- reads Bias AI bias table, OB AI ATR banner
data_get_pine_boxes Read Pine box objects (price zones) [STRATEGY] -- reads OB AI order block zones, FVG zones

All four support the study_filter parameter to target a specific indicator by name. See Pine Graphics Deep Dive for detailed return formats and examples.


Pane Tools

Tools for managing multi-chart layouts (split panes). Each pane is an independent chart widget that can display a different symbol.

Tool Description Strategy Use
pane_list List all panes with their symbols, resolutions, and active index Debugging
pane_set_layout Set the chart grid layout (split configuration) Not used
pane_focus Focus a specific pane by index (activates it for subsequent commands) Not used
pane_set_symbol Set the symbol on a specific pane by index Not used

Layout Codes

The pane_set_layout tool accepts the following layout codes:

Code Description Alias
s 1 chart (single) 1, 1x1, single
2h 2 horizontal (side by side) 2x1
2v 2 vertical (stacked) 1x2
2-1 2 top, 1 bottom
1-2 1 top, 2 bottom
3h 3 horizontal 3x1
3v 3 vertical 1x3
3s 3 custom
4 2x2 grid 2x2, grid, quad
4h 4 horizontal
4v 4 vertical
4s 4 custom
6 6 charts
8 8 charts
10 10 charts
12 12 charts
14 14 charts
16 16 charts

Pane Workflow Example

1. pane_set_layout("4")       -- switch to 2x2 grid
2. pane_set_symbol(0, "ES1!") -- set first pane to ES
3. pane_set_symbol(1, "NQ1!") -- set second pane to NQ
4. pane_set_symbol(2, "YM1!") -- set third pane to YM
5. pane_set_symbol(3, "RTY1!")-- set fourth pane to RTY
6. pane_focus(0)              -- return focus to first pane

Tab Tools

Tools for managing TradingView Desktop browser tabs. Each tab is a separate chart page with its own layout and symbol.

Tool Description Strategy Use
tab_list List all open chart tabs (ID, title, URL, chart ID) Debugging
tab_new Open a new chart tab (Ctrl+T / Cmd+T) Not used
tab_close Close the current tab (Ctrl+W / Cmd+W). Refuses to close the last tab. Not used
tab_switch Switch to a tab by index. Uses CDP Target.activateTarget to bring the tab to front. Not used

Tab vs. Pane

Tabs are separate chart pages (like browser tabs) -- switching tabs changes the entire view. Panes are split-screen panels within a single tab -- they share the same view but can show different symbols.


Watchlist Tools

Tools for reading and modifying the TradingView watchlist panel.

Tool Description Strategy Use
watchlist_get Get all symbols in the active watchlist with last price, change, and change% Future: scan symbol universe
watchlist_add Add a symbol to the watchlist Not used

watchlist_get Detection Methods

The watchlist_get tool uses a multi-method fallback strategy to read symbols:

  1. data-symbol-full attributes -- Reads data-symbol-full attributes from watchlist row elements (preferred, includes price data)
  2. Text scan -- Scans the right panel for ticker-like text patterns matching [A-Z][A-Z0-9.:!]{0,20}
  3. Panel closed -- Returns empty if the watchlist panel is not visible

Indicator Tools

Tools for managing indicators on the chart beyond basic add/remove.

Tool Description Strategy Use
indicator_set_inputs Change indicator input values by entity ID (e.g., {"length": 50}) Not used
indicator_toggle_visibility Show or hide an indicator by entity ID Not used

These complement the chart_manage_indicator tool (which handles add/remove) by providing fine-grained control over existing indicators.

indicator_set_inputs

Changes the input parameters of an indicator already on the chart. Requires the entity ID (from chart_get_state) and a JSON object of input overrides.

indicator_set_inputs(entity_id: "eFu1Ot", inputs: '{"in_3": 20}')

Input keys use TradingView's internal naming (e.g., in_0, in_1, in_3) which can be discovered via data_get_indicator.

indicator_toggle_visibility

Shows or hides an indicator without removing it. Useful for temporarily decluttering the chart while preserving the indicator configuration.

indicator_toggle_visibility(entity_id: "eFu1Ot", visible: false)

Pine Script

Tools for reading, editing, and compiling Pine Script source code. Not used by the strategy layer (which is read-only), but useful for indicator development.

Tool Description Strategy Use
pine_get_source Get Pine Script source of an indicator Not used
pine_set_source Set/replace Pine Script source Not used
pine_compile Compile Pine Script and check for errors Not used
pine_smart_compile Compile with auto-fix suggestions Not used
pine_get_errors Get current compilation errors Not used
pine_save Save Pine Script to TradingView Not used
pine_get_console Read Pine Script console output (log.*) Not used
pine_new Create a new Pine Script Not used
pine_open Open an existing Pine Script by name Not used
pine_list_scripts List saved Pine Scripts Not used
pine_analyze Analyze Pine Script structure and dependencies Not used
pine_check Validate Pine Script without full compilation Not used

Strategy Layer Tool Usage Summary

The strategy layer uses 6 tools during each scan cycle:

Tool Called By Purpose
tv_health_check scan.js (startup) Verify TradingView connection
chart_get_state scan.js Read current symbol and timeframe
data_get_pine_labels bias-reader.js, session-reader.js, smt-reader.js Read label graphics from 3 indicators
data_get_pine_lines session-reader.js, ob-reader.js Read line graphics from 2 indicators
data_get_pine_tables bias-reader.js, ob-reader.js Read table graphics from 2 indicators
data_get_pine_boxes ob-reader.js Read box graphics from OB AI

Each scan cycle makes at most 8 MCP tool calls (1 health check + 1 chart state + 4 Pine graphics reads run in parallel + potential verbose re-reads). The study_filter parameter on each Pine graphics call ensures only the target indicator's graphics are returned.