genart.dev
MCP ToolsParameters

set_canvas_size

Change the canvas dimensions of a sketch using a preset name or explicit width/height.

Input Schema

ParameterTypeRequiredDescription
sketchIdstringyesID of the sketch to update
presetstringnoCanvas preset name (e.g. "square-1200", "hd-1920x1080")
widthnumbernoExplicit width in pixels
heightnumbernoExplicit height in pixels

Either preset or both width and height must be provided.

Output Shape

{
  "success": true,
  "sketchId": "noise-grid",
  "canvas": { "width": 1920, "height": 1080 },
  "previousCanvas": { "width": 1200, "height": 1200 }
}

Side Effects

  • Updates sketch canvas dimensions in memory
  • Saves sketch to disk
  • Sends sketch:updated sidecar notification

Error Cases

ConditionError
No workspace open"No workspace is currently open"
Unknown sketch ID"Sketch not found: 'bad-id'"
Unknown preset"Unknown canvas preset: 'bad-preset'"
No dimensions"Provide either a preset or both width and height"

Golden Path Example

Request:

{ "sketchId": "noise-grid", "preset": "hd-1920x1080" }

Response:

{
  "success": true,
  "sketchId": "noise-grid",
  "canvas": { "width": 1920, "height": 1080 },
  "previousCanvas": { "width": 1200, "height": 1200 }
}