Skip to main content
Glama
pbajkovic-hub

tv-cdp-mcp

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
TV_CDP_PORTNoPort the CDP session connects to on 127.0.0.19222
TV_EXPORT_DIRNoWhere tv_export_data writes files<repo>/exports
TV_DENY_SYMBOLSNoComma-separated tickers the trading tools always refuse
TV_MAX_RISK_USDNoPaper-trading gate: max USD at risk per entry50
TV_DEFAULT_EXCHANGENoExchange prefix applied to bare tickers (ethusdt → BYBIT:ETHUSDT.P)BYBIT
TV_MAX_OPEN_POSITIONSNoPaper-trading gate: max simultaneous open positions2

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
tv_list_alertsA

List the account's TradingView alerts with their machine-readable firing condition. Read-only. Returns at most 200 projected rows in the same order as the TradingView alert panel (newest first), each with panel_pos = its 1-based row on the full unfiltered list, plus id, symbol, resolution, name, description (the string the UI shows), type, complexity, active, expiration, conditionType, condition, hasWebhook, webhookUrl, message. Refer to an alert by name + symbol, never by position alone. In list mode the description is capped at 400 chars, message at 200, and study inputs / plotOffsets maps with more than 20 entries are collapsed to a count - use tv_get_alert for the full detail.

tv_get_alertA

Read one alert in full: the complete description, the untruncated firing condition (including every study input), the projected alert model, and the raw snake_case REST payload from listAlerts() for that id. Read-only. presentation_data is omitted - it is megabytes of chart state and is never needed to edit an alert.

tv_set_alert_conditionA

MUTATES a live alert: shallow-merge patch (camelCase model fields: conditions, message, webhook, name, resolution, ...) into the alert through the same modifyRestartAlert call path the TradingView UI uses - the ONLY path the server accepts (raw snake_case payload round-trips are rejected with invalid_request and were removed). Returns { id, patched_keys, sent, previous, current, was_active, paused_restored, current_raw } so the change is reversible - feed previous back as the next patch to undo it. Refuses an empty patch, identity fields (id/alert_id) and unknown field names. ARMED WINDOW: modify_restart always re-arms the alert; if it was paused before the call it is stopped again right after (~1s later, paused_restored: true) - a fire inside that window would deliver the alert's real message/webhook. Clone -> modify -> stop path verified live 2026-09-05 on defanged throwaway clones. Alerts on this account fire real webhooks that place live orders.

tv_pause_alertsA

MUTATES: stop (pause) the given alerts via AlertsCollection.stopAlerts - they stay defined but stop firing. Returns per-id { previous_active, current_active } read back from the server, so tv_resume_alerts reverses it. Verified live 2026-09-04 on a price alert.

tv_resume_alertsA

MUTATES: restart (resume) the given alerts via AlertsCollection.restartAlerts - they begin firing again, webhooks included. Returns per-id { previous_active, current_active } read back from the server, so tv_pause_alerts reverses it. Verified live 2026-09-04 on a price alert.

tv_create_alertA

MUTATES: create a new alert by CLONING an existing one (from_id) server-side and retargeting the clone through the UI's own modifyRestartAlert path, with optional overrides for symbol, resolution (applied to the alert AND every condition - they move together), name, message and web_hook (empty string removes the webhook). Clone-based because it must be: /create_alert rejects every hand-built payload (invalid_request), and only an existing alert carries the live study plots + pineId a strategy condition needs. The new alert is created PAUSED by default - resuming it is a separate, explicit tv_resume_alerts call. ARMED WINDOW: when overrides are applied, modify_restart re-arms the clone and the stop rail lands right after (~1s) - a fire inside that window would deliver the alert's real message/webhook; a pure clone with no overrides never arms. If the retarget fails the clone is deleted again automatically. Returns { new_id, cloned_from, active, alert, warning? }. Clone -> modify -> stop path verified live 2026-09-05 on defanged throwaway clones. Alerts on this account fire real webhooks that place live orders.

tv_delete_alertsA

MUTATES: PERMANENTLY delete the given alerts (REST /delete_alerts via the alerts REST handler; there is no undo - a deleted alert can only be re-created by cloning another one). Requires confirm=true. Every id is resolved to name + symbol BEFORE anything is deleted (unknown ids abort the whole call), and the result echoes { id, name, symbol, resolution, active } per deleted alert plus confirmed_gone read back from the server list (the delete can lag seconds; still_present lists ids that were still there after ~5 s). VERIFIED LIVE 2026-09-05: a paused clone (id 7700000006) deleted, confirmed gone in ~1 s.

tv_list_layoutsA

List every open TradingView chart tab (index, layout id, title, url) and which one is actually painting (active). Read-only; the paint probe runs one requestAnimationFrame per tab.

tv_get_chart_stateA

Read the active chart: symbol, extended symbol info, resolution, chart type, study count, saved layout name and layout id. Read-only.

tv_set_symbolA

MUTATES the chart: change the active chart symbol (e.g. "BYBIT:ETHUSDT.P"). Returns { previous, current } so the change can be reverted. TradingView does not validate the symbol up front - check symbol_resolved in the result.

tv_set_resolutionB

MUTATES the chart: change the active chart timeframe/resolution ("1", "5", "60", "1D", "1W"). Returns { previous, current } so the change can be reverted.

tv_screenshotA

Capture a PNG screenshot of the chart tab and return it as an image. Read-only. Set clip_to_chart to crop to the chart container.

tv_get_barsA

Read OHLCV bars of the active chart straight from the loaded series (newest last). Read-only. Returns at most 500 bars; TradingView only holds what has been scrolled into memory, so available tells you how many bars the chart currently has. Also reports whether the symbol failed to resolve.

tv_get_study_valuesA

Read the plotted values of one study for the most recent bars (newest last). Read-only. Accepts a study id or a case-insensitive part of its name. Each row is keyed by plot title (e.g. "Buy", "Sell", "Plot (plot_8)"); colour/fill plots are dropped unless include_decoration=true. Built-in studies such as Volume have no series and return the formatted data-window strings instead.

tv_export_dataA

Read-only: export the active chart as one table - OHLCV bars plus the plotted values of every study (or the studies you name) joined on bar time - to a CSV (default) or JSON file under the export directory, or inline with write=false. TradingView Desktop refuses its own "Export chart data", so this composes the export from the loaded series: at most 500 bars and only what the chart has scrolled into memory. Studies without a data series (built-in Volume etc.) are listed under skipped. Column names are " | ". Returns symbol, resolution, bar count, first/last bar, the columns and the file path.

tv_list_saved_layoutsA

List the saved chart layouts of the logged-in TradingView account (id, layout id, name, symbol, resolution, modified). Read-only; from TradingViewApi.getSavedCharts(). Optional name filter (case-insensitive substring).

tv_open_chart_urlA

Open a TradingView chart URL (or bare layout id) in the bound chart tab - own layouts and other users' shared / View Only charts alike. Full page reload, ~20 s; waits until the chart is ready and reports the layout it landed on, its owner and whether it is read-only. Refuses while the current layout has unsaved changes unless discard_changes=true.

tv_copy_layoutA

TradingView "Make a copy": clone the layout shown in the bound tab (optionally opening source_url first, e.g. someone else's View Only chart) into a new saved layout with the given name. Settles when the copy appears in the saved-layout list (45-60 s: server clone + page reload); reports which tab shows it (TV Desktop opens a copy of another user's chart in a NEW tab). Refuses an empty name or a name that already exists among the saved layouts unless allow_duplicate_name=true.

tv_rename_layoutA

Rename the layout shown in the bound tab (TradingView "Rename"). Refuses a read-only / View Only chart. Returns the previous and new name.

tv_delete_layoutA

Delete ONE saved layout from the TradingView account by layout id, numeric id or exact name. Irreversible: requires confirm=true, refuses anything listed in protect (ids or names), and refuses the layout currently shown in the bound tab unless force=true. Verifies by re-listing.

tv_list_studiesA

List the indicators/strategies on the active TradingView chart with their study ids. Read-only.

tv_get_study_inputsA

Read one study's inputs with their human names, types, options and ranges. Accepts a study id or a case-insensitive name substring. Read-only.

tv_set_study_inputsA

MUTATES the chart: set one or more inputs on a study by id, then re-read them. Values are coerced to the input's declared type and validated against its options/min/max. Returns the previous value for every change so it can be undone.

tv_study_templateA

Indicator (study) templates of the TradingView account, one tool switched on action. list (read-only): saved templates - custom first, then the built-in standard/fundamental ones. snapshot (read-only): the study set of the chart on screen as a template object (optionally written to file) - take one before apply so it can be undone. save: store the chart's studies under name (POST /api/v1/study-templates; replace=true to overwrite an existing custom template). apply: MUTATES THE CHART - REPLACES EVERY STUDY on the layout with the template from name (saved), template (inline) or file (JSON); returns studies before/after. delete: remove a custom template by name; confirm=true required; built-ins refuse. Verified live: full round trip - snapshot, save (listed in ~2 s), apply back (studies_before == studies_after), delete with confirm (gone in ~1 s).

tv_trading_statusA

Read the broker connected inside TradingView: broker id/title, account id/type, connection, open positions, working orders, capability flags and the gate this server enforces. Pass symbol to also check tradability, qty step/min and the chart price. Read-only.

tv_place_orderA

MUTATES the connected TradingView broker: place an order with a mandatory stop loss and optional take profit through the in-page broker adapter. PAPER ONLY - refuses unless the broker is TradingView Paper Trading on a demo account. Gate (configurable): risk <= 50 USD, max 2 open positions, one position per symbol, denied symbols refused. qty is sized from risk_usd / stop distance unless qty is given. Market orders size off the chart price of the active layout (set the chart to the symbol) or entry_price. dry_run=true returns the exact pre-order and sends nothing; use it first.

tv_close_positionA

MUTATES the connected TradingView broker: close an open position by symbol or position id (market close via the broker adapter). PAPER ONLY. Returns the position that was closed and the remaining open positions.

tv_cancel_orderA

MUTATES the connected TradingView broker: cancel one working order by id (entry orders; bracket orders belong to their position). PAPER ONLY. Returns the cancelled order and the remaining working orders.

tv_set_position_bracketsA

MUTATES the connected TradingView broker: move the stop loss and/or take profit of an OPEN position via the broker adapter (editPositionBrackets). PAPER ONLY - refuses unless the broker is TradingView Paper Trading on a demo account. Give symbol or position_id and at least one of stop_loss / take_profit; the value you leave out keeps its current level (both are always sent). Sanity gate against the position side and price: long needs stop_loss < price < take_profit, short the reverse - no override. Returns previous and applied levels plus the position before/after, read back until the broker shows the new values. dry_run=true returns the plan and sends nothing; use it first. Verified live against a paper position: stop moved and restored, ~450 ms each.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A4/5.0

Scored across 29 tools

Disambiguation5/5

Every tool targets a distinct resource and action—alerts, layouts, chart state, studies, and trading each have clear boundaries. Even similar-sounding tools like tv_list_alerts vs tv_get_alert or tv_list_layouts vs tv_list_saved_layouts are unambiguously separated by read scope and detail.

Naming Consistency4/5

The dominant pattern is tv_verb_noun in snake_case (list_alerts, set_symbol, delete_layout), which is consistent and predictable. Minor deviations include tv_screenshot, tv_study_template (noun with action parameter), and tv_trading_status, but these do not undermine the overall pattern.

Tool Count4/5

29 tools is on the higher end for an MCP server, but the server covers five distinct domains (alerts, layouts, chart, studies, trading), and each tool has a distinct role. The count feels justified rather than bloated, though it is close to the upper bound of what is appropriate.

Completeness4/5

The surface is nearly complete for the stated scope: full CRUD for alerts and layouts, chart inspection and mutation, study input management, template lifecycle, and paper trading operations. Minor gaps exist—such as no way to remove a single study from a chart or modify an existing order's price/size—but agents can work around them.

Maintenance

ActivityMaintained
ResponsivenessNo issues