MCP ToolsCapture & Layout
capture_batch
Capture PNG screenshots of multiple sketches in parallel — batch variant of `capture_screenshot` for generating thumbnails or comparison grids.
Input Schema
| Parameter | Type | Required | Description |
|---|---|---|---|
sketchIds | string[] | no | IDs of sketches to capture (default: all loaded sketches) |
width | number | no | Override output width for all captures (default: each sketch's canvas width) |
height | number | no | Override output height for all captures (default: each sketch's canvas height) |
seed | number | no | Override seed for all captures (doesn't mutate sketch state) |
format | 'png' | 'base64' | no | Output format (default: 'base64') |
savePath | string | no | Directory to save PNGs (files named {sketchId}.png) |
Output Shape
{
"success": true,
"total": 3,
"captured": 3,
"failed": 0,
"results": [
{
"sketchId": "noise-grid",
"success": true,
"width": 1200,
"height": 1200,
"seed": 42,
"image": "data:image/png;base64,iVBORw0KGgo...",
"savedTo": null
}
]
}When some captures fail, success is false and errors is included:
{
"success": false,
"total": 3,
"captured": 2,
"failed": 1,
"results": [ ... ],
"errors": [
{ "sketchId": "broken-sketch", "error": "Renderer error message" }
]
}Side Effects
- If
savePathprovided: writes PNG files to the directory as{sketchId}.png - Does not mutate sketch state (seed override is temporary)
Error Cases
| Condition | Error |
|---|---|
| No workspace open | "No workspace is currently open" |
| No sketches to capture (empty list, empty workspace) | "No sketches to capture" |
A sketchId not found | "Sketch not found: 'bad-id'" |
| Individual renderer failure | Captured in errors array, does not abort batch |
Golden Path Example
Request:
{
"sketchIds": ["noise-grid", "wave-pattern"],
"width": 400,
"height": 400,
"format": "base64"
}Response:
{
"success": true,
"total": 2,
"captured": 2,
"failed": 0,
"results": [
{
"sketchId": "noise-grid",
"success": true,
"width": 400,
"height": 400,
"seed": 42,
"image": "data:image/png;base64,iVBORw0KGgo...",
"savedTo": null
},
{
"sketchId": "wave-pattern",
"success": true,
"width": 400,
"height": 400,
"seed": 7890,
"image": "data:image/png;base64,iVBORw0KGgo...",
"savedTo": null
}
]
}capture_screenshot
Capture a PNG screenshot of a sketch, multiple sketches, or the workspace viewport — the verification step in the create→capture→analyze→fix loop.
snapshot_layout
Return a structural summary of the workspace layout — all sketches with positions, sizes, renderer types, groups, and bounding box — without full algorithm or philosophy content.