> ## Documentation Index
> Fetch the complete documentation index at: https://opencanvas.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# get_screenshot: Capture Canvas Screenshot

> Capture the live DesignJS iframe as a base64-encoded PNG or JPEG, optionally at 2x resolution for high-fidelity visual inspection by your agent.

The `get_screenshot` tool renders the canvas iframe to an image and returns it as a base64-encoded data URL. This gives your agent true visual access to the design — not just the DOM tree or computed styles, but the actual rendered pixels. Use screenshots to verify layout changes, check that colors match a reference, detect overflow, or pass the image to a vision-capable model for detailed feedback.

By default, the screenshot is captured at 1x device pixel ratio in PNG format. Use `scale: 2` to capture a high-DPI image with sharper text and crisp edges, and `format: "jpeg"` to reduce payload size when exact color fidelity is less important.

## Parameters

<ParamField path="scale" type="number">
  Device pixel ratio for the captured image. Accepts `1` (default, standard resolution) or `2` (high-DPI, 2× resolution). Use `2` when passing the screenshot to a vision model or inspecting fine typographic detail.
</ParamField>

<ParamField path="format" type="string">
  Output image format. Accepts `"png"` (default, lossless) or `"jpeg"` (lossy, smaller file size). Use `"jpeg"` when bandwidth or context window size is a concern and pixel-perfect accuracy is not required.
</ParamField>

<ParamField path="artboardId" type="string">
  Scope the screenshot to a single artboard rather than the full canvas viewport. Obtain artboard IDs from `list_artboards`.
</ParamField>

## Response

<ResponseField name="dataUrl" type="string" required>
  A base64-encoded data URL in the format `data:image/png;base64,...` or `data:image/jpeg;base64,...`. Pass this directly to a vision model or decode it to write the bytes to disk.
</ResponseField>

<ResponseField name="width" type="number" required>
  Width of the captured image in pixels, accounting for scale. A 1440px canvas at `scale: 2` returns `width: 2880`.
</ResponseField>

<ResponseField name="height" type="number" required>
  Height of the captured image in pixels, accounting for scale.
</ResponseField>

## Example

<CodeGroup>
  ```json request — standard resolution PNG theme={null}
  {
    "method": "tools/call",
    "params": {
      "name": "get_screenshot",
      "arguments": {}
    }
  }
  ```

  ```json request — high-DPI JPEG of an artboard theme={null}
  {
    "method": "tools/call",
    "params": {
      "name": "get_screenshot",
      "arguments": {
        "scale": 2,
        "format": "jpeg",
        "artboardId": "artboard-001"
      }
    }
  }
  ```
</CodeGroup>

```json response theme={null}
{
  "content": [
    {
      "type": "text",
      "text": "{\"dataUrl\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...\", \"width\": 1440, \"height\": 900}"
    }
  ]
}
```

<Warning>
  Screenshots of large canvases at `scale: 2` produce large base64 strings. If your model has a context window or image size limit, prefer `scale: 1` or `format: "jpeg"` for routine checks, and `scale: 2` only when fine detail is critical.
</Warning>

<Tip>
  When using a multi-step agent loop (read → change → verify), call `get_screenshot` after each write operation to visually confirm the result before proceeding to the next change.
</Tip>
