Render preview
render_previewGenerate a PNG preview of an SVG document to visually inspect its current state. Optionally set width for scaling and receive an inline image for immediate feedback.
Instructions
Render a PNG preview of the whole document into the artifacts dir.
When to use: a quick visual check of the whole document. For a final file use `export_document`;
for one object use `export_object`; for an ordered run series use `capture_frame`.
Key params: `width_px` scales the raster (height follows the document aspect ratio); omit for
intrinsic size. Oversized requests are rejected before Inkscape runs. `name` tags the file
(successive calls do NOT clobber, — each render gets a unique frame name). INLINE RASTER
: by default the PNG is also returned as an MCP image block so the agent SEES it without
a second Read; gated by max_output_bytes (~5 MiB default) and skipped for an oversized
render; inline=False returns only the structured result.
Return shape: `PreviewResult` — `artifact_path` / `workspace_relative_path` (same root-relative
value), `format`, `width_px`/`height_px` (TRUE on-disk size), `stale`. With an inline
image, a `ToolResult` carrying the same structured fields plus the image block.
Example: `render_preview(doc_id, width_px=512)`
Risk class: low (render/export to artifact dir; no original overwrite).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| doc_id | Yes | ||
| inline | No | ||
| width_px | No | ||
| max_output_bytes | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stale | No | ||
| doc_id | Yes | ||
| format | Yes | ||
| width_px | Yes | ||
| all_blank | No | ||
| height_px | Yes | ||
| opaque_px | No | ||
| artifact_path | Yes | ||
| workspace_relative_path | Yes |