particlr-mcp
v0.5.0Agents author particlr .prt particle effects headlessly: validate, simulate, render to PNG, patch.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
validate_effect Validate Effect
Validate a .prt document (JSON string) against the real parse -> migrate -> validate pipeline. Returns ok + the canonical normalized doc + schemaVersion (and the pre-migration version), or structured, path-anchored errors worded for you to fix.
| Parameter | Type | Description |
|---|---|---|
doc | string | The .prt document as a JSON string. |
handle | string | A handle from open_effect — use instead of doc to avoid resending the document. |
simulate_effect Simulate Effect
Deterministically step a .prt effect in Node (no rendering) and report per-layer live counts over time, peak vs capacity, spatial bounds, completion, and a statehash plus the exact {seed, dt, steps} to reproduce it. Same seed + dt sequence => identical output. Code layers hold no particles and are skipped. Validates first; an invalid doc returns validate-shaped errors.
| Parameter | Type | Description |
|---|---|---|
doc | string | The .prt document as a JSON string. |
dt | number | Fixed timestep. Default 1/60; clamped to [0.001, 0.05] (the runtime MAX_DT). |
duration | number | Seconds to simulate. Default 3; capped at 60. |
handle | string | A handle from open_effect — use instead of doc to avoid resending the document. |
sampleInterval | number | Seconds between count samples. Default 0.1; floor 0.001, widened if it would emit more than 4096 samples. |
seed | integer | Override the doc's authored seed. Default: the doc's seed. |
list_presets List Presets
List the shipped .prt presets (name, layer count, schemaVersion) — the few-shot authoring corpus.
get_preset Get Preset
Fetch one shipped preset by name (stem): its raw .prt text plus a parsed summary. Unknown name returns an error listing the valid names.
| Parameter | Type | Description |
|---|---|---|
name * | string | The preset filename stem (see list_presets), e.g. "explosion". |
get_reference Get Reference
Fetch reference material inline: topic "format-spec" (the .prt format spec, markdown) or "schema" (the JSON Schema for a .prt document).
| Parameter | Type | Description |
|---|---|---|
topic * | string | "format-spec" = the .prt format spec (markdown); "schema" = the JSON Schema for a .prt document; "authoring-guide" = how to author a .prt that LOOKS good (units, blend/layer/curve/trail recipes, commo… |
render_effect Render Effect
CPU-rasterize a .prt effect to PNG image(s): by default one contact-sheet PNG of 16 frames evenly spaced over [0, completion||duration], auto-framed. All builtin + embedded-PNG textures, all five blend modes, flipbook, stretch/velocity-align/flip, per-particle + connect-ribbon TRAILS, and layer draw order are rendered; DISSOLVE is NOT rasterized (a dissolve doc still renders its sprites). Code layers draw from their editor-baked frames (`baked`); you cannot bake (layer code never runs here), so a code layer without `baked` is skipped with a warning. Deterministic: frames snap to the same 1/60…
| Parameter | Type | Description |
|---|---|---|
background | string | Background: "checker" (default), "transparent", or a hex color (#rgb / #rrggbb / #rrggbbaa). |
doc | string | The .prt document as a JSON string. |
fps | number | Frames at 0, 1/fps, 2/fps … up to the range end (max 240). Overrides `frames`. |
frames | integer | Number of evenly-spaced frames over [0, completion||duration]. Default 16; max 64. |
handle | string | A handle from open_effect — use instead of doc to avoid resending the document. |
height | integer | Frame height in px. Default 256; cap 1024 longest edge. |
layout | string | "sheet" (default): one contact-sheet PNG. "separate": one PNG per frame (same caps). |
overrunSeconds | number | Render past the loop seam: extends the frames/fps time range to duration + overrunSeconds. Looping docs only; ignored (with a warning) otherwise. Explicit `times` already accept any time. |
seed | integer | Override the doc's authored seed. Default: the doc's seed. |
supersample | number | Anti-alias by rendering at 2x/4x then downsampling. Default off (crisp, byte-golden). |
times | array | Explicit render times in seconds (snapped to 1/60 boundaries). Max 64 entries, each <= 60s. Overrides frames/fps. |
viewport | object | Explicit world-space viewport. Auto-framed from a bounds scan (+12% margin) when omitted. |
width | integer | Frame width in px. Default 256; cap 1024 longest edge. |
open_effect Open Effect
Validate a .prt document and store it under a session handle so you can iterate without resending the text. Returns the handle + validate fields (ok, schemaVersion, warnings, errors); pass the handle to patch_effect / validate_effect / simulate_effect / render_effect. Handles live only for this session (server process); they do not survive a reconnect. Capped at 64 per session.
| Parameter | Type | Description |
|---|---|---|
doc * | string | The .prt document as a JSON string. Validated and stored under a fresh handle. |
patch_effect Patch Effect
Apply a small list of RFC 6902 ops (replace/add/remove) to a stored effect, then re-validate. Iterate by sending only the diff, not the whole document. Any failure — bad path/index or a post-patch validation error — rolls back: the stored doc is left unchanged and the failing op index is named. Handles live only for this session (server process); they do not survive a reconnect.
| Parameter | Type | Description |
|---|---|---|
handle * | string | A handle from open_effect. |
ops * | array | Restricted RFC 6902 ops (replace/add/remove) applied IN ORDER (max 64). Any failure — bad path, bad index, or a post-patch validation error — rolls back: the stored doc is unchanged. |
get_effect Get Effect
Fetch the canonical stored .prt text for a handle — use this for final delivery/export after iterating. Handles live only for this session (server process); they do not survive a reconnect.
| Parameter | Type | Description |
|---|---|---|
handle * | string | A handle from open_effect. |