screenshot_full
Capture the full TradingView viewport as a base64-encoded PNG for saving or sharing chart states.
Instructions
Capture the full TradingView viewport as a base64-encoded PNG.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/screenshot.ts:48-61 (handler)The main handler function for the 'screenshot_full' tool. Takes an empty input, calls page.screenshotFull(), and returns the screenshot output schema. Wraps errors in ToolExecutionError.
export async function screenshotFull( _input: z.infer<typeof screenshotFullInput>, page: TradingViewPage, ): Promise<z.infer<typeof screenshotFullOutput>> { try { return await page.screenshotFull(); } catch (cause) { throw new ToolExecutionError( 'screenshot_full', 'Failed to capture full viewport screenshot.', cause, ); } } - src/connection/tradingview.ts:393-399 (handler)The low-level implementation that captures the full TradingView viewport using CDP (Chrome DevTools Protocol). Takes a full-page screenshot via this.cdp.screenshot() and retrieves viewport dimensions via evaluate().
async screenshotFull(): Promise<Screenshot> { const data = await this.cdp.screenshot(); const dims = await this.cdp.evaluate<{ width: number; height: number }>( `({ width: window.innerWidth, height: window.innerHeight })`, ); return { format: 'png', data, width: dims.width, height: dims.height }; } - src/tools/screenshot.ts:45-46 (schema)Input schema: an empty strict object (no parameters required).
export const screenshotFullInput = z.object({}).strict(); export const screenshotFullOutput = screenshotOutputSchema; - src/tools/screenshot.ts:46-46 (schema)Output schema (shared with screenshot_chart): { format: 'png', data: base64 string, width: number, height: number }.
export const screenshotFullOutput = screenshotOutputSchema; - src/tools/index.ts:149-155 (registration)Registration of 'screenshot_full' in the TOOLS array with name, description, input/output schemas, and the handler reference.
{ name: 'screenshot_full', description: 'Capture the full TradingView viewport as a base64-encoded PNG.', input: screenshotFullInput, output: screenshotFullOutput, handler: screenshotFull, },