Render HTML
render_htmlRender an HTML string in a real browser and return a screenshot to check components, emails, or pages before deployment. Use it to inspect local HTML without hosting.
Instructions
Render an HTML string in a real browser and return a screenshot you can see. Use it to check a component, email or page you just wrote without deploying it, and to look at local work, since the capture service cannot reach localhost. The HTML is hosted at an unguessable temporary URL, captured like any page, deleted as soon as the capture returns, and the result has the same shape as capture_screenshot. Assets must be inlined or use absolute public URLs: relative paths and localhost URLs inside the HTML will not load unless the HTML sets to a public origin. The page runs in a sandbox without cookies or localStorage, so code that depends on them may render blank. Cookie-banner hiding is off for this tool, so the page renders exactly as written. Costs 1 screenshot of the monthly quota per call. Takes about 9-25 seconds. Do not put secrets in the HTML: the resulting image link is public to anyone who has it.
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": {
"html": "<html>"
},
"name": "render_html"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| html | Yes | The HTML document or fragment to render, at most 2 MB. Inline the CSS and JS it needs, or load them from absolute public URLs. Relative asset URLs only resolve if the HTML sets <base href>. | |
| scale | No | Device pixel ratio of the stored image: 1 (default), 2 (retina) or 3. Affects the file at screenshot_url; inline images are downscaled either way. | |
| width | No | Viewport width in CSS pixels. API default 1280. Ignored when device is set. | |
| detail | No | Size of the inline images. "standard": at most 1280 px wide, about 1,568 tokens per image. "high": at most 1920 px wide, about 4,784 tokens per image; use it only to read small text. | standard |
| device | No | Device preset: sets the viewport and, for phones, a mobile user agent. Overrides width and height. iphone* and pixel* are phones, ipad* are tablets, the rest are fixed desktop sizes. | |
| height | No | Viewport height in CSS pixels. API default 800. Ignored when device is set. | |
| return | No | "image_and_url" attaches the images. "url_only" returns just the link and sizes, for when you need the file but do not need to look at it (uses no image tokens). | image_and_url |
| element | No | CSS selector of one element to capture, for example "#pricing" or "main .hero". Cheapest way to look at one part of a page. A selector that matches nothing makes the capture fail (and still uses quota). | |
| wait_ms | No | Extra wait in milliseconds after load, before the capture. API default 2000. Raise it for late animations or client-side rendering. | |
| full_page | No | Capture the whole scrollable page instead of just the viewport. Tall pages are returned as several image slices and cost more tokens. | |
| max_slices | No | Maximum number of inline images. A tall capture is cut into slices from the top; slices beyond this are left out and reported as truncated. Slices are also left out if the inline images would exceed about 1.5 MB in total (4 MB at high detail). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | Yes | Format of the stored file at screenshot_url. | |
| images | Yes | One entry per inline image, in the same order as the image blocks. | |
| original | Yes | Pixel size of the stored image. Null if it could not be read. | |
| warnings | Yes | Things worth knowing about this result, for example an error status from the page. | |
| truncated | Yes | True when images were requested and some slices were left out, because of max_slices or the inline size limit. Always false with return: "url_only", where no image is attached by request. | |
| origin_url | Yes | ||
| captured_at | Yes | ISO 8601 UTC time of the capture. | |
| page_status | Yes | HTTP status the page answered with. 400 or above usually means an error page was captured. | |
| total_slices | Yes | How many slices the whole image needs at this detail level, whether or not they are attached. With return: "url_only" this is how many a normal call would produce. | |
| screenshot_url | Yes | Full-resolution image. Public to anyone who has the link. | |
| expires_in_days | Yes | Stored files are deleted after this many days. | |
| estimated_image_tokens | Yes | Approximate total vision tokens of the inline images. |