Screenshot an element or region
screenshotCaptures a browser tab as an image, letting AI agents inspect viewports, elements, or page regions with configurable format, quality, and width.
Instructions
Screenshot via CDP — defaults to JPEG (far smaller than PNG; pass format:'png' for lossless). Pass ref (from read_page/find, main-frame elements only) to capture just that element, or region [x, y, width, height] (page coordinates) for a rectangle; omit both for a viewport capture. maxWidth downscales the result. Returns an image.
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": {
"tabId": "<tabId>"
},
"name": "screenshot"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Element ref to clip to | |
| tabId | Yes | Target tab ID (must be in the MCP group) | |
| format | No | Image format (default jpeg) | |
| region | No | [x, y, width, height] in page coordinates (width/height 1-20000) | |
| quality | No | JPEG quality 1-100 (default 80) | |
| maxWidth | No | Downscale so width ≤ this (keeps aspect ratio) |