MCP ToolsMerging
merge_sketches
Combine parameters, colors, and algorithm elements from two or more source sketches into a new sketch, using a configurable merge strategy.
Input Schema
| Parameter | Type | Required | Description |
|---|---|---|---|
sourceIds | string[] | yes | IDs of 2+ source sketches to merge (min 2) |
newId | string | yes | URL-safe kebab-case ID for the merged sketch |
title | string | yes | Title for the merged sketch |
strategy | 'blend' | 'layer' | 'alternate' | no | Merge strategy (default: 'blend') |
renderer | 'p5' | 'three' | 'glsl' | 'canvas2d' | 'svg' | no | Renderer for merged sketch (default: first source's renderer) |
canvas | { width?: number, height?: number } | no | Canvas size (default: largest source dimensions) |
Strategy Details
- blend: Union of all parameters and colors from all sources. If parameter keys conflict, the first source's definition wins. Algorithm is taken from the first source.
- layer: Parameters are namespaced per source (e.g.,
source1_count,source2_count). All colors are merged. Algorithm is taken from the first source with a layering comment header. - alternate: Parameters from odd-indexed sources and colors from even-indexed sources. Algorithm from first source.
Output Shape
{
"success": true,
"sketchId": "merged-sketch",
"title": "Merged Sketch",
"path": "/absolute/path/to/merged-sketch.genart",
"renderer": "p5",
"strategy": "blend",
"sources": ["sketch-a", "sketch-b"],
"parameterCount": 8,
"colorCount": 5
}Side Effects
- Creates a new
.genartfile in the workspace directory - Adds the new sketch to the active workspace
- Saves the workspace file
Error Cases
| Condition | Error |
|---|---|
| Fewer than 2 source IDs | "At least 2 source sketches are required" |
| Source sketch not found | "Sketch not found: 'bad-id'" |
| No workspace open | "No workspace is currently open" |
| Duplicate newId | "Sketch with ID 'merged-sketch' already exists" |
| Unknown strategy | "Unknown merge strategy: 'invalid'. Valid strategies: blend, layer, alternate" |
Golden Path Example
Request:
{
"sourceIds": ["sketch-a", "sketch-b"],
"newId": "merged-ab",
"title": "Merged A+B",
"strategy": "blend"
}Response:
{
"success": true,
"sketchId": "merged-ab",
"title": "Merged A+B",
"path": "/workspace/merged-ab.genart",
"renderer": "p5",
"strategy": "blend",
"sources": ["sketch-a", "sketch-b"],
"parameterCount": 8,
"colorCount": 5
}export_sketch
Export a sketch as a standalone HTML file, raw algorithm code, PNG image, or SVG — producing a self-contained artifact viewable outside the genart editor.
list_skills
List all available design knowledge skills from the skill registry, with metadata about each skill's topic and complexity.