Capture a page screenshot
websitePreview_captureRenders one page of the site in a real browser and returns the image, so you can check layout, spacing, and responsive behaviour that source-level checks cannot see. path is site-relative and may include a query string, so dynamic routes are captured with real values rather than placeholders. Focus the capture with selector (plus optional padding for surrounding context) or a clip rectangle in CSS pixels from the top-left of the page; the region is scrolled into view and captured within the configured viewport, so it must fit inside it, and these options exclude each other and fullPage. Fonts, images, and (for fullPage) lazy content are awaited before the capture, and CSS animations are fast-forwarded to their end state by default. Fails with 409 when the draft build is still in progress or has failed; poll websiteSourceCode.deployment.status and retry.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"websiteId": "<websiteId>"
},
"name": "websitePreview_capture"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clip | No | Crop to this rectangle, in CSS pixels from the top-left of the rendered page at the chosen viewport; it is scrolled into view and must fit within the viewport. Only for regions no selector frames. | |
| path | No | Site-relative path to render, including any query string, e.g. `/blog/my-post`. | / |
| target | No | `head` renders the current draft; `published` renders the live site. | head |
| delayMs | No | Extra settle time before capturing, in milliseconds. | |
| padding | No | CSS pixels of surrounding page to include on every side of the `selector` match. | |
| fullPage | No | Capture the whole scrollable page instead of just the viewport. Excludes `selector` and `clip`. | |
| scrollTo | No | Scroll to a CSS selector or an absolute Y offset before capturing. | |
| selector | No | Crop to the first element matching this CSS selector, scrolled into view. Preferred: it follows the layout at every viewport. | |
| viewport | No | Device class to render at. | desktop |
| websiteId | Yes | ||
| colorScheme | No | Browser color preference to emulate. Omit it to use the renderer default. | |
| waitForSelector | No | Wait for this CSS selector to match before capturing. | |
| freezeAnimations | No | Fast-forward CSS animations and transitions to their end state so captures are deterministic. |