MCP ToolsSketch Lifecycle
open_sketch
Load a `.genart` file into the editor state so it can be viewed and modified by other tools.
Input Schema
| Parameter | Type | Required | Description |
|---|---|---|---|
sketchId | string | yes | ID of the sketch to open (must already be in the active workspace) |
Output Shape
{
"success": true,
"id": "noise-grid",
"title": "Noise Grid",
"renderer": "p5",
"canvas": { "width": 1200, "height": 1200 },
"parameterCount": 3,
"colorCount": 2,
"seed": 42,
"philosophy": "# Noise Grid\n\nA grid of cells colored by Perlin noise.",
"algorithmLength": 1247
}Side Effects
- Sets the editor selection to the opened sketch
- Notifies the sidecar of a selection change
Error Cases
| Condition | Error |
|---|---|
| Sketch not found in state | "Sketch not found: 'bad-id'" |
| No workspace open | "No workspace is currently open" |
Golden Path Example
Request:
{
"sketchId": "noise-grid"
}Response:
{
"success": true,
"id": "noise-grid",
"title": "Noise Grid",
"renderer": "p5",
"canvas": { "width": 1200, "height": 1200 },
"parameterCount": 1,
"colorCount": 1,
"seed": 42,
"philosophy": null,
"algorithmLength": 245
}