Rebuild From Screenshot
You are recreating a chart layout from a user-provided screenshot using vision + MCP tools.
Step 1: Receive the Screenshot
The user pastes an image. Visually read it and extract:
- Symbol — from the top-left ticker label
- Timeframe — from the resolution selector (e.g., "5", "15", "1H", "D")
- Chart type — Candles, Heikin Ashi, Line, Bars, etc.
- Indicators — every pane + overlay study (names + approximate params like "EMA(200)")
- Drawings — trend lines, rectangles, horizontal levels, text
- Visible date range — leftmost to rightmost bar dates
Step 2: Capture Live Chart State
chart_vision_read — returns combined image + readings (symbol, timeframe, indicator list, key values) in one call. Prefer this over separate capture_screenshot + chart_get_state for this workflow.
If chart_vision_read fails with CHART_LOADING, wait and retry once.
Step 3: Diff
Compare the pasted screenshot against the chart_vision_read output. Build a minimal change list:
- Symbol match? If not, queue
chart_set_symbol
- Timeframe match? If not, queue
chart_set_timeframe
- Indicator set — which to add, which to remove, which to reconfigure
- Drawings — which to add (source coords from the screenshot), which to clear
Step 4: Apply Changes
Execute in this order to minimize reflows:
chart_set_symbol (e.g., "NASDAQ:TSLA")
chart_set_timeframe (e.g., "60")
chart_set_type if needed (e.g., "HeikinAshi")
- For each missing indicator:
chart_manage_indicator with action: "add" and indicator: set to the
full name ("Moving Average Exponential", not "EMA"). The key is indicator, not name —
an unknown key is silently dropped and the call then fails with "indicator is required for add action"
indicator_set_inputs to match params. It needs entity_id (from chart_get_state) and inputs
as a JSON string, e.g. inputs: '{"length": 200}'
- For each drawing:
- Horizontal level →
draw_shape with shape: "horizontal_line" and point: { time, price }.
time is required even for a horizontal line — use the last bar time from chart_get_visible_range
- Trend line →
draw_shape with shape: "trend_line" + point and point2, both { time, price }
- Text →
draw_shape with shape: "text" and a text string
- If leftover studies/drawings don't belong:
chart_manage_indicator remove + draw_remove_one by id
Concrete example — rebuilding a TSLA 1H chart with EMA(20)/EMA(200) and a horizontal at 250.00:
chart_set_symbol("NASDAQ:TSLA")
chart_set_timeframe("60")
chart_manage_indicator({ action: "add", indicator: "Moving Average Exponential" })
chart_manage_indicator({ action: "add", indicator: "Moving Average Exponential" })
chart_get_state() // read both entity_ids back
indicator_set_inputs({ entity_id: "<ema1 entity_id>", inputs: '{"length": 20}' })
indicator_set_inputs({ entity_id: "<ema2 entity_id>", inputs: '{"length": 200}' })
chart_get_visible_range() // bars_range.to is the last bar time
draw_shape({ shape: "horizontal_line", point: { time: 1741964700, price: 250.00 } })
Step 5: Verify
chart_vision_read again — confirm the new live state
- Diff once more against the user's screenshot
- If mismatches remain (e.g., indicator param still off), iterate on step 4
Step 6: Report
Tell the user what was applied, what couldn't be matched exactly (e.g., proprietary indicators not recognizable by name), and show the final screenshot path.
Error Notes
CHART_LOADING — chart still rendering; wait 1-2s and retry
INDICATOR_NOT_FOUND — name in screenshot isn't a built-in (likely custom Pine); ask user to load it manually
- If colors/styles matter for the match, mention them but don't chase perfection — focus on structural fidelity
1---2name: rebuild-from-screenshot-33description: Reproduce a chart from a screenshot — read the user's pasted image, diff against the live chart, then set symbol/indicators/drawings to match. Use when the user pastes a chart image and says "recreate this" or "set up my chart like this".4---56# Rebuild From Screenshot78You are recreating a chart layout from a user-provided screenshot using vision + MCP tools.910## Step 1: Receive the Screenshot1112The user pastes an image. Visually read it and extract:1314- **Symbol** — from the top-left ticker label15- **Timeframe** — from the resolution selector (e.g., "5", "15", "1H", "D")16- **Chart type** — Candles, Heikin Ashi, Line, Bars, etc.17- **Indicators** — every pane + overlay study (names + approximate params like "EMA(200)")18- **Drawings** — trend lines, rectangles, horizontal levels, text19- **Visible date range** — leftmost to rightmost bar dates2021## Step 2: Capture Live Chart State22231. `chart_vision_read` — returns combined image + readings (symbol, timeframe, indicator list, key values) in one call. Prefer this over separate `capture_screenshot` + `chart_get_state` for this workflow.2425If `chart_vision_read` fails with `CHART_LOADING`, wait and retry once.2627## Step 3: Diff2829Compare the pasted screenshot against the `chart_vision_read` output. Build a minimal change list:3031- Symbol match? If not, queue `chart_set_symbol`32- Timeframe match? If not, queue `chart_set_timeframe`33- Indicator set — which to add, which to remove, which to reconfigure34- Drawings — which to add (source coords from the screenshot), which to clear3536## Step 4: Apply Changes3738Execute in this order to minimize reflows:39401. `chart_set_symbol` (e.g., `"NASDAQ:TSLA"`)412. `chart_set_timeframe` (e.g., `"60"`)423. `chart_set_type` if needed (e.g., `"HeikinAshi"`)434. For each missing indicator: `chart_manage_indicator` with `action: "add"` and `indicator:` set to the44 **full name** ("Moving Average Exponential", not "EMA"). The key is `indicator`, not `name` —45 an unknown key is silently dropped and the call then fails with "indicator is required for add action"465. `indicator_set_inputs` to match params. It needs `entity_id` (from `chart_get_state`) and `inputs`47 as a JSON **string**, e.g. `inputs: '{"length": 200}'`486. For each drawing:49 - Horizontal level → `draw_shape` with `shape: "horizontal_line"` and `point: { time, price }`.50 `time` is required even for a horizontal line — use the last bar time from `chart_get_visible_range`51 - Trend line → `draw_shape` with `shape: "trend_line"` + `point` and `point2`, both `{ time, price }`52 - Text → `draw_shape` with `shape: "text"` and a `text` string537. If leftover studies/drawings don't belong: `chart_manage_indicator` remove + `draw_remove_one` by id5455Concrete example — rebuilding a TSLA 1H chart with EMA(20)/EMA(200) and a horizontal at 250.00:5657```58chart_set_symbol("NASDAQ:TSLA")59chart_set_timeframe("60")60chart_manage_indicator({ action: "add", indicator: "Moving Average Exponential" })61chart_manage_indicator({ action: "add", indicator: "Moving Average Exponential" })62chart_get_state() // read both entity_ids back63indicator_set_inputs({ entity_id: "<ema1 entity_id>", inputs: '{"length": 20}' })64indicator_set_inputs({ entity_id: "<ema2 entity_id>", inputs: '{"length": 200}' })65chart_get_visible_range() // bars_range.to is the last bar time66draw_shape({ shape: "horizontal_line", point: { time: 1741964700, price: 250.00 } })67```6869## Step 5: Verify70711. `chart_vision_read` again — confirm the new live state722. Diff once more against the user's screenshot733. If mismatches remain (e.g., indicator param still off), iterate on step 47475## Step 6: Report7677Tell the user what was applied, what couldn't be matched exactly (e.g., proprietary indicators not recognizable by name), and show the final screenshot path.7879## Error Notes8081- `CHART_LOADING` — chart still rendering; wait 1-2s and retry82- `INDICATOR_NOT_FOUND` — name in screenshot isn't a built-in (likely custom Pine); ask user to load it manually83- If colors/styles matter for the match, mention them but don't chase perfection — focus on structural fidelity