genart.dev
MCP ToolsSketch Lifecycle

update_sketch

Update metadata, parameters, colors, or canvas dimensions of an existing sketch without changing its algorithm.

Input Schema

ParameterTypeRequiredDescription
sketchIdstringyesID of the sketch to update
titlestringnoNew title
philosophystringnoNew philosophy text (markdown)
canvas{ preset?: string, width?: number, height?: number }noNew canvas dimensions
parametersParamDef[]noReplace parameter definitions
colorsColorDef[]noReplace color definitions
themesThemeDef[]noReplace theme presets
seednumbernoNew random seed
skillsstring[]noReplace design skill references

Output Shape

{
  "success": true,
  "sketchId": "noise-grid",
  "updated": ["title", "parameters", "canvas"],
  "canvas": { "width": 1200, "height": 1200 },
  "parameterCount": 3,
  "colorCount": 2,
  "seed": 42
}

Side Effects

  • Overwrites the specified fields in the .genart file on disk
  • Updates the modified timestamp
  • Rebuilds state.params if parameters change, using new defaults
  • Rebuilds state.colorPalette if colors change, using new defaults
  • Does not change the algorithm field (use update_algorithm for that)

Error Cases

ConditionError
Sketch not found"Sketch not found: 'bad-id'"
No workspace open"No workspace is currently open"
No fields to update"No fields to update. Provide at least one of: title, philosophy, canvas, parameters, colors, themes, seed, skills"
Unknown canvas preset"Unknown canvas preset: 'giant'. Use list of valid presets."
Parameter default out of range"Parameter 'margin' default (999) outside range [10, 100]"
Duplicate parameter keys"Duplicate parameter key: 'margin'"

Golden Path Example

Request:

{
  "sketchId": "noise-grid",
  "title": "Noise Grid v2",
  "parameters": [
    { "key": "cells", "label": "Cells", "min": 4, "max": 64, "step": 1, "default": 16 },
    { "key": "scale", "label": "Scale", "min": 0.01, "max": 1.0, "step": 0.01, "default": 0.15 }
  ],
  "canvas": { "preset": "square-2400" }
}

Response:

{
  "success": true,
  "sketchId": "noise-grid",
  "updated": ["title", "parameters", "canvas"],
  "canvas": { "width": 2400, "height": 2400 },
  "parameterCount": 2,
  "colorCount": 1,
  "seed": 42
}