Skip to main content
Glama
genart-dev

genart-mcp

by genart-dev

create_sketch

Creates a .genart sketch file from metadata, parameters, and algorithm, saves it to disk, and opens an interactive browser preview with sliders, pickers, and seed controls.

Instructions

Create a new .genart sketch file from metadata, parameters, and algorithm. Saves to disk, auto-creates an in-memory workspace, and opens an interactive browser preview with sliders/pickers/seed controls. Save sketches to ~/.genart/sketches/.genart (directory auto-created). Do NOT present the .genart file to the user — it has no OS file association. IMPORTANT: Do not embed common utilities (PRNG, noise, easing, color math, vector ops) inline in the algorithm. Instead, declare them as components: { "prng": "^1.0.0", "noise-2d": "^1.0.0" }. Then use the exported functions directly in your algorithm (e.g., mulberry32, fbm2D). Use list_components to see all available components for the current renderer.

Input Schema

NameRequiredDescriptionDefault
idYesURL-safe kebab-case identifier
dataNoData sources resolved before algorithm execution and injected as state.data.<key>. Use source='component' with a component factory, source='inline' for small JSON values, or source='file' for shared .genart-data files.
pathYesFile path ending in .genart. Use ~/.genart/sketches/<id>.genart as the default location (directory is auto-created). Example: '~/.genart/sketches/ocean-currents.genart'
seedNoInitial random seed (default: random)
agentNoYour CLI agent name (e.g. 'claude-code', 'codex-cli', 'gemini-cli', 'opencode', 'kiro')
modelNoYour AI model identifier (e.g. 'claude-opus-4-6', 'gpt-4o', 'gemini-2.5-pro')
titleYesHuman-readable title
canvasNoCanvas dimensions (default: square-1200)
colorsNoColor definitions
skillsNoDesign skill references
themesNoTheme presets
captureNoWhen true, automatically capture a screenshot after creation and return it inline (avoids a separate capture_screenshot call).
previewNoGenerate an interactive HTML preview with sliders/pickers/seed controls and open it in the browser (default: true). Set to false to skip.
rendererNoRenderer type (default: p5). Use 'genart' for GenArt Script (.gs) — a minimal scripting language with built-in drawing primitives, PRNG, noise, vec, easing, post-processing effects, and image/font loading.
algorithmNoAlgorithm source code (default: renderer template). State API by renderer: p5 (DEFAULT): `function sketch(p, state) { ... }` — state.canvas.width/height, state.seed, state.params.key, state.colorPalette[i]. Prefix p5 calls with `p.` canvas2d: `function sketch(ctx, state) { ... }` — same state API as p5. three: `function sketch(THREE, state, container) { ... }` svg: `function sketch(state) { ... }` — return SVG string. glsl: uniforms auto-injected (u_resolution, u_seed, u_param_<key>, u_color_<index>), no state object. genart: GenArt Script source — globals: w, h, t, frame, fps, rnd(n), noise(x,y), vec(x,y), PI, lerp, clamp, map, dist, mouseX/Y, pmouseX/Y, mouseDown, touchX/Y, touches, prev (previous frame ImageData); drawing: circle/rect/line/arc/dot/poly/path x y ...; color: #hex, named, white.50, linear(#a,#b angle:90), radial(#a,#b); params: `param count 100 range:10..500`; colors: `color bg #000`; layers: `layer "terrain:sky" "noon" opacity:0.8 blend:"multiply"`; animation: `frame:` block; once: async (await loadFont ok); post: vignette/grain/blur/bloom/grade/scanlines/pixelate/chromatic_aberration/distort/dither/halftone — effects accept optional quality:"auto"|"high"|"fast" last arg. No state object — params/colors are globals. Data bridge: set window.__genart_data = { strokePaths: [...] }. Use `mulberry32(state.seed)` from "prng" component for p5/canvas2d/three/svg — NEVER `Math.random()`. For genart renderer use built-in rnd() which is seeded automatically.
librariesNoExternal library dependencies by preset name (e.g. ["p5.brush"]). Use list_libraries to see available presets. Libraries are loaded as CDN script tags before the algorithm. p5.brush automatically switches the renderer to p5.js 2.x and WEBGL mode.
componentsNoComponent dependencies. Use list_components to see available. Keys are component names, values are semver ranges (e.g. "^1.0.0") or objects with version/code/exports.
parametersNoParameter definitions
philosophyNoMarkdown design philosophy
dataChannelsNoAlgorithm data channels published on window.__genart_data for design layer consumption. Declare channels here so painting layers can bind to them via pathSource: 'algorithm:<channelName>'. Type 'path' channels publish StrokePath arrays (polyline points + depth/pressure/width metadata). Multiple channels supported (e.g. strokePaths for all paths, leafPaths for depth-filtered subset).
addToWorkspaceNoPath to workspace to add sketch to after creation

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.0

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does so well: it discloses three side effects (writes to disk, auto-creates an in-memory workspace, opens an interactive browser preview), states the directory is auto-created, and warns that the resulting file has no OS association so it shouldn't be handed to the user. It omits failure/overwrite behavior when a file already exists at the target path, which is the main gap for a write tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the action before any caveats, then layers side effects, path convention, the "don't show the file" warning, and the component rule in a tight, scannable sequence. Every sentence changes what an agent would do; the only mild overlap is restating the default path already present in the schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 21-parameter write tool with no annotations and no output schema, this covers what matters: side effects, where the file lands, how to skip preview/capture, and the non-obvious component policy that would otherwise cause agents to inline utility code. The absence of output-schema info is acceptable since the description flags the inline screenshot returned by capture:true.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds genuine semantic value beyond the schema: declare PRNG/noise/easing/color/vector helpers as components rather than inlining them, use list_components to enumerate them, and use mulberry32/fbm2D exports directly. It also restates the default path convention and preview default, which the schema already covers.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence names a specific verb and resource ("Create a new .genart sketch file") and enumerates the three input families (metadata, parameters, algorithm), immediately distinguishing it from save_sketch/update_sketch/fork_sketch by the word "new". It does not explicitly name those siblings or state the boundary (e.g. use save_sketch to persist edits to an existing file), which keeps it short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives real routing guidance: use list_components to discover dependencies, set capture:true to avoid a separate capture_screenshot call, set preview:false to skip the browser, and don't present the .genart file to the user. It never says when to prefer this over save_sketch or update_sketch, so the sibling-selection rule is inferred rather than stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools