MCP ToolsCapture & Layout
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.
Input Schema
| Parameter | Type | Required | Description |
|---|---|---|---|
target | 'selected' | 'sketch' | 'workspace' | 'viewport' | no | What to capture (default: 'selected') |
sketchId | string | no | Required when target is 'sketch' |
width | number | no | Output image width in pixels (default: sketch canvas width) |
height | number | no | Output image height in pixels (default: sketch canvas height) |
seed | number | no | Override seed for this capture only (doesn't mutate sketch state) |
params | object | no | Override params for this capture only (doesn't mutate sketch state) |
format | 'png' | 'base64' | no | Output format (default: 'base64') |
savePath | string | no | If provided, save PNG to this path in addition to returning |
Output Shape
{
"success": true,
"target": "selected",
"sketchId": "noise-grid",
"width": 1200,
"height": 1200,
"seed": 42,
"image": "data:image/png;base64,iVBORw0KGgo...",
"savedTo": null
}For target: 'workspace', returns a composite image of all visible artboards at their canvas positions. For target: 'viewport', returns what's currently visible in the viewport at the current zoom level.
Side Effects
- If
savePathprovided: writes PNG file to disk - Does not mutate sketch state (seed/param overrides are temporary)
Error Cases
| Condition | Error |
|---|---|
target is 'selected' but nothing selected | "No sketch is currently selected" |
target is 'sketch' but no sketchId | "sketchId is required when target is 'sketch'" |
sketchId not found in workspace | "Sketch not found: 'bad-id'" |
| Renderer fails to produce frame | "Renderer error for 'noise-grid': [error message]" |
| No workspace open | "No workspace is currently open" |
Golden Path Example
Request:
{
"target": "selected",
"seed": 99999
}Response:
{
"success": true,
"target": "selected",
"sketchId": "noise-grid",
"width": 1200,
"height": 1200,
"seed": 99999,
"image": "data:image/png;base64,iVBORw0KGgo...",
"savedTo": null
}search_sketches
Search loaded sketches by title, renderer type, parameter count, canvas size, or other metadata — returning matching results with relevance.
capture_batch
Capture PNG screenshots of multiple sketches in parallel — batch variant of `capture_screenshot` for generating thumbnails or comparison grids.