Skip to main content
Glama
harshil1502

tradingview-mcp

by harshil1502

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

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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,
        );
      }
    }
  • 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 };
    }
  • Input schema: an empty strict object (no parameters required).
    export const screenshotFullInput = z.object({}).strict();
    export const screenshotFullOutput = screenshotOutputSchema;
  • Output schema (shared with screenshot_chart): { format: 'png', data: base64 string, width: number, height: number }.
    export const screenshotFullOutput = screenshotOutputSchema;
  • 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,
    },
Behavior3/5

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

No annotations provided, so the description carries the full burden. It discloses the action and output format, but lacks details on side effects, performance, or permission requirements. Adequate for a simple tool.

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?

Single sentence that is front-loaded with the action and resource. No unnecessary words, every part earns its place.

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

Completeness4/5

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

Given zero parameters and no output schema, the description adequately covers what the tool does and the output format. Could mention any constraints (e.g., chart must be loaded), but not required for this simplicity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Zero parameters, so the baseline is 4 per rubric. The description does not need to add parameter info, and the schema coverage is 100%.

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?

The description clearly states the action ('Capture'), the specific resource ('full TradingView viewport'), and the output format ('base64-encoded PNG'). It is distinct from siblings like screenshot_chart, which likely captures a chart area.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool versus alternatives (e.g., screenshot_chart). However, the zero-parameter simplicity implies it's for full viewport capture, which is moderately clear.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/harshil1502/tradingview-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server