genart.dev
MCP ToolsWorkspace Management

add_sketch_to_workspace

Add an existing `.genart` sketch file to the active workspace at an optional canvas position.

Input Schema

ParameterTypeRequiredDescription
sketchPathstringyesPath to the .genart file to add
position{ x: number, y: number }noCanvas position (default: auto-placed to the right of existing sketches)
labelstringnoDisplay label override for the workspace

Output Shape

{
  "success": true,
  "file": "noise-grid.genart",
  "id": "noise-grid",
  "title": "Noise Grid",
  "position": { "x": 1400, "y": 0 },
  "sketchCount": 3
}

Side Effects

  • Modifies the .genart-workspace file on disk (adds sketch reference)
  • Loads the sketch into the editor state cache
  • Does not modify the .genart file

Error Cases

ConditionError
No workspace open"No workspace is currently open"
Sketch file doesn't exist"Sketch file not found: /path/to/missing.genart"
Sketch already in workspace"Sketch 'noise-grid.genart' is already in the workspace"
Invalid .genart file"Invalid .genart file: /path/to/bad.genart — [parse error]"

Golden Path Example

Request:

{
  "sketchPath": "~/projects/genart/outputs/noise-grid.genart",
  "position": { "x": 2800, "y": 0 },
  "label": "v3 - Noise Grid"
}

Response:

{
  "success": true,
  "file": "noise-grid.genart",
  "id": "noise-grid",
  "title": "Noise Grid",
  "position": { "x": 2800, "y": 0 },
  "sketchCount": 3
}