Skip to content

Screenshots

import { Aside } from ‘@astrojs/starlight/components’;

Capture an image of the current page. Screenshots are saved to the workspace’s .ptah/screenshots/ folder by default and the saved path is returned along with inline image data.

NameTypeRequiredDefaultDescription
fullPagebooleannofalseIf true, capture the entire scrollable page
selectorstringnoClip the screenshot to this element
formatenumnopngOne of png, jpeg, webp
qualitynumberno90Compression quality for jpeg and webp (1–100)
omitBackgroundbooleannofalseTransparent background (PNG/WebP only)
pathstringnoCustom output path; relative paths resolve against the workspace
{
"tool": "ptah_browser_screenshot",
"arguments": {
"fullPage": true,
"format": "png"
}
}
{
"tool": "ptah_browser_screenshot",
"arguments": {
"selector": "#pricing-table",
"format": "jpeg",
"quality": 80
}
}
FormatWhen to use
pngDefault. Lossless, supports transparency. Best for UI screenshots and diffs.
jpegSmallest file for photographic content. No transparency.
webpBest compression/quality balance; supports transparency.

Full-page screenshots work by scrolling the document and stitching frames. Pages that lazy-load content on scroll (infinite feeds, virtualised lists) may produce partially blank regions. In those cases, scroll and capture in segments, or call ptah_browser_evaluate to trigger eager loading before the capture.