Change what is there
canvas_editChange things already on your open canvas, without repainting: everyone watching sees each change happen. edits, made in order:
{target: a name or key "b.i", set: {any op properties; null removes one}}: recolor, reshape, resize, rename, re-layer...
{target, move: {dx, dy}}: shift it (adds to its at).
{target, points: [...]}: change single points or pieces of a path, polygon, stroke or line, in its own coordinates (canvas_get lists its numbered points; each change applies to the result of the one before): {i, x, y} or {i, dx, dy} moves point i (a curve's handles move with it); {i, delete: true}; {after: i, x, y} adds a point; {segment: i, line: true} straightens the piece ending at point i; {segment: i, curve: [[x1, y1], [x2, y2]]} makes it a curve.
{target, order: "top"|"bottom"|"up"|"down"} or {target, order: {above: a name or key on the same layer}}: within its layer.
set {hidden: true} hides an object or part from everyone (kept, and listed); set {locked: true} locks it: every other edit to it, its parts or its group is refused until set {locked: null}. People hide and lock things in the layers panel: leave them as they are unless asked.
{target, delete: true}.
{target, detach: true}: an instance (a use, such as a placed part) becomes its own copy of its source as it looks now, its palette and kit baked in; it no longer follows the master.
{target, child: {id, set}} or {target, child: {id, delete: true}} edits one group child (id or its name). {target, child: {insert, before}} inserts before a child id. Use after to insert after it or omit both to append. canvas_get shows child IDs. A part's path as target ("balloon/flag", "head/eyes/open/lid-l": ids or names, as deep as groups nest) takes set, move, delete, child (when the part is a group) and order (among its group's parts, last drawn on top; {above: a sibling's id or name}).
{group: [names or keys], name}: makes them one named group, where the topmost was; their names become its parts' names. {target, ungroup: true}: a group's parts become objects again, in its place.
{targets: [names or keys], move: {dx, dy}, scale, rot, origin: [x, y]}: moves, scales and turns them together about one origin (default: the centre of their shared bounds).
{layer: "sky", opacity, blend, hidden, locked, order: "top"|"bottom"|"up"|"down"}: a layer's settings (makes the layer if it is new). Use before or after with an existing layer name to place it beside that layer. erase is a closed path to cut out (null clears it). Locked layers must be unlocked before editing their objects.
{layers: ["water", "fish"]} places named layers at the bottom in that order, creating any missing layers.
{kit: {colors: {brand: "#0a7cff", ink: "#14213d"}, fonts: {heading: "ui"}}}: the canvas's brand kit (added to what it has; null removes a name; replace: true starts it afresh). Or kit as a string of CSS custom properties from a site (":root { --brand: #0a7cff; --font-heading: 'Bebas Neue', sans-serif }"): colors and font families are taken, dark-mode rules become the kit's dark mode, other values are left out. styles: {name: {font, size, weight, lh, spacing}} are text styles; elevation: {raised: {dx, dy, blur, color, opacity}} are shadows an op names (shadow "raised") (text style: "name"); modes: {dark: {colors}} and mode: "dark" draw the canvas in a mode. A kept brand sets all of this at once: canvas_brand adopt. Or kit {url: "https://example.com"}: read from that web page (its HTML and up to 4 stylesheets, fetched once, never run): its custom properties under the site's own names, else the colors it uses most (page1, page2 ...), and its body and heading fonts as the nearest faces here; colors or fonts given beside url win. Ops use "var(--brand)" wherever a color goes and "var(--heading)" as a text font; changing the kit then changes every object that uses it, so one kit edit rethemes the canvas. Fonts are this canvas's faces (sans, ui, code, serif, mono, hand, marker, display, poster, heavy, hangul, dots, slam, grotesk, or an uploaded font's id); a family name is matched to the nearest of them.
{reference: {src: an https URL or a data: URL, x?, y?, w?, h?, fit?: "contain"|"cover"|"fill", opacity?}}: a picture under everything to paint against (a screenshot of a page to match, say), the whole canvas unless x, y, w, h say otherwise; or {reference: {img: an id}}: a picture this canvas or another of your canvases keeps (copied here), so a frame uploaded once serves every canvas. Locked; downloads and exports leave it out. {reference: null} takes it away. The reply lists its main colors to take as the kit. In a piece of shots, {reference: {src}, shot: "s3"} gives one shot its own (a frame of the video it matches; {reference: null, shot: "s3"} takes it away): canvas_look then shows and compares the shot's own while it shows, else the canvas's.
{frames: {page: {size: "desktop"}, phone: {size: "phone"}, og: {size: "og", x: -1400, y: 0}, icon: {x, y, w, h}}}: artboards (named frames), the sized parts of the design, each exported on its own at its own size (canvas_export frame) and seen alone with canvas_look frame. They sit anywhere on the open surface (-20000..20000 each way), side by side; drawing outside every artboard is kept (notes, spare parts) and is in no file. size is og 1200×630, icon 512×512, hero 1440×640, square 1080×1080, banner 1500×500; a web width, desktop (1440), tablet (768), phone (390), whose height grows with what is drawn in it (or h sets one); or, with Studio Plus, an exact "WxH". The file is that many pixels and the artboard that many units, unless w or h is given; a new one goes to the right of the others unless x, y are given. Or x, y, w, h in units. Give an artboard that exists only what changes ({og: {x: 40}}); null removes one; replace: true starts afresh. Up to 40. Artboards are never drawn in the picture.
{paper: {strength: 0.6, grain: 0.5}}: prints the canvas on paper: soft blotches and fibres under everything, a fine grain over everything (lines and type too). Neither moves with cameras or motion. A number is the strength; null takes it away.
{print: {strength: 0.6, register: 1.5, dropout: 0.6, stain: 0.3, seed}}: a cheap risograph or screen print look: ragged ink edges, each ink (kit name or color; a lined shape's fill and line apart) off register by up to register px, ink dropping out in specks and streaks, soft stains. Static: it moves only with a shot's camera. A shot's own (canvas_shot print) wins; false there for none. A number is the strength; null takes it away. overprint 0..1 (default 0, inks cover): where inks in a layer cross they multiply as real riso inks do (navy over orange comes out dark brown, pink dots over a cream shape a duller rose), so you need not pick a color for every crossing; each ink alone and the paper keep their colors. It is per layer: a layer over another covers it (put highlights and anything that must cover on a layer above); an op's own blend wins over it. 1 is the riso look; between 0 and 1 draws each ink twice (slower). canvas_undo takes back a whole call of edits. canvas_list shows names, keys and layers.
{comment: 3, reply: "what you changed", done: true}: answers feedback (as canvas_feedback does). frame {size: wide|square|portrait|tall|panorama or "WxH", background}: the canvas's own shape and background color (not a named frame), only while nothing is drawn on it (a canvas someone started for you): edits may then be left out.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "canvas_edit"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| look | No | the after preview as canvas_look would show it: {frame (an artboard), view {x, y, w, h}, focus [names], time, strip, span, shot} (alone, it asks for preview after). With no frame, view or focus, a call that painted inside one artboard previews that artboard. With mode validate: a dry run, nothing saved or shown to people | |
| mode | No | forgiving applies usable items (default), validate saves nothing, atomic applies all or none | |
| next | No | what your next call will paint ("the animals, zone by zone"): shown to people watching while they wait | |
| note | No | ||
| edits | No | changes, made in order | |
| frame | No | size and background, before anything is drawn | |
| canvas | No | ||
| preview | No | Attach a PNG after, or before and after | |
| request_id | No | your own id for this call (a UUID): sent again after a timeout or a dropped connection, the call is not made twice; the reply says it was made the first time | |
| working_on | No | what you are about to change: object names, kit fields ("kit.colors.accent") or frames; people watching see them marked as being worked on, and canvas_open tells a second assistant, for a minute or until your next call. A soft claim, not a lock | |
| model_label | No | Optional public model name for the painting cursor, labeled as reported. Use only if your client knows it. | |
| preview_width | No | Pixels across for the preview (default 480; alone, it asks for preview after) | |
| expected_revision | No | Apply only at this drawing revision |