Morpha
AI editor to build, animate & export layered short-form video projects via one tool catalog.
Community: Submitted by a user or imported; check the owner before granting accessOnlineAPI key requiredGlobalFreeRead-only
What it can do
What data it sees
Do you need an account
An API key from the service settings is required
AI editor to build, animate & export layered short-form video projects via one tool catalog.
Server tool list (98)
Raw names from tools/list. Only developers need these.
| list_projects | List projects as { id, name, editorUrl } entries. The id is what every other tool's `projectId` argument takes. `name` is the human-readable label shown in the editor's project picker ("Untitled" when no name has been set — ids are opaque and never shown to the user, so always refer to a project by its name). `editorUrl` is a tappable link that opens that project in the editor — offer it to the user (by name) when they want to look at one. By default lists the user's OWN personal projects (those not in any workspace). Pass `workspaceId` (from list_workspaces) to instead list the projects that live in that workspace — including teammates' — each with the owner's `ownerEmail`. Call this when the user asks "what projects do I have?" or hasn't named a project but you need to operate on one. |
| list_workspaces | List the workspaces (shared team spaces) the account belongs to, as { id, name, role, memberCount } entries. `role` is the caller's role in that workspace (owner / admin / editor / viewer) — only owner/admin/editor can add projects. Use the `id` as the `workspaceId` argument to create_project, move_project_to_workspace, and list_projects; refer to the workspace by its `name` when talking to the user (never paste the id). Returns an empty list when the account has no email (workspace membership is email-based, so a keyless/dev identity sees none). Call this to discover a workspace before placing a project into it. |
| create_workspace | Create a new workspace (a shared team space) owned by the caller, and return it as { id, name, role, memberCount }. Use this when the user wants a new place to group projects — then move_project_to_workspace files projects into it, and create_project can place new ones there directly. The caller becomes its owner. Requires an account with an email (workspace membership is email-based), so a keyless identity cannot create one. Refuses with a conflict if the caller already owns a workspace with the same name, which is almost always a repeated request rather than a genuine second workspace. Refer to it by `name` when talking to the user, never the id. |
| rename_workspace | Rename an existing workspace. Requires an owner or admin role in it (the same roles that may change its membership); an editor or viewer is refused. Takes the workspace id from list_workspaces. Touches only the label — membership, projects and roles are unchanged. |
| open_project | Get a tappable link that opens a project directly in the editor (the editor loads exactly this project from the URL). Returns { name, editorUrl }. Use this whenever the user wants to view their work — after you make a change, or when they say "show me" / "open it" — then give them the editorUrl and invite them to tap it. Refer to the project by its name in your reply; the link is the tap target. |
| create_project | Create a new project and return its server-minted id. The id is an opaque v4 UUID assigned automatically — you never choose or name it; refer to the project by its `name`. By default this mints a fresh BLANK project (empty canvas, no layers) — creation is independent from cloning. Pass `fromProjectId` ONLY when you want to clone: the new project then copies that project's JSON, uploaded assets, and uploaded clips, and — like duplicate_project — FOLLOWS THE SOURCE'S workspace by default (cloning a team project stays in that team; a blank project is personal). Pass `workspaceId` (from list_workspaces) to place it in a specific workspace instead — requires an edit-capable role there — or null to force it into the caller's personal space. If the clone source lives in a workspace you can only view, the call FAILS rather than silently making a personal copy — pass workspaceId:null for a personal copy. The user's editor session won't auto-refresh — they'll need to reload to see the new project in the picker. |
| move_project_to_workspace | Move a project into a workspace, or back to the caller's personal space. Pass `workspaceId` (from list_workspaces) to place the project in that workspace — every member then sees it, with their workspace role deciding edit vs view. Pass `workspaceId: null` to detach it back to personal. Requires an edit-capable role (owner/admin/editor) in the TARGET workspace and write access to the project. Switching a project from one workspace to another cleanly drops the old membership. |
| list_collection | List the user's reusable Collection — layers they added with add_to_collection (lower-thirds, logo stings, brand intros, or any single layer). Returns { items: [{ scope, workspaceId, sourceProjectId, sourceProjectName, ownerEmail, elementId, name, kind, childCount }] }. `scope` is "personal" (from the user's own solo projects) or "team" (from a workspace they belong to). Show the user each item's `name` (and its `sourceProjectName`); `sourceProjectId` + `elementId` feed add_from_collection to drop a self-contained COPY into another project. Works on a solo account (personal items always included); takes no arguments. |
| add_from_collection | Add an item from the user's Collection into a project as a self-contained COPY. Pass the destination `projectId`, plus the `sourceProjectId` + `elementId` of an item from list_collection. Copies that layer (a whole group brings its children) plus its image/clip/font bytes into the destination at fresh ids and its original canvas position — fully detached, so it is immediately yours to edit and nothing links back to the source (deleting or changing the source never affects this copy). The element must actually be in the source project's collection and you must be able to read that project. An open editor on the destination picks the copy up within a few seconds — no refresh needed. Returns { addedElementId, count }. |
| duplicate_project | Duplicate an existing project into a brand-new one — a full copy of its layers, animations, styles, uploaded assets, and clips. Pass the SOURCE project's `projectId`; the copy gets a fresh id automatically (ids are opaque — never shown to the user). Defaults the copy's name to "<source name> copy" unless you pass `name`. WORKSPACE: the copy FOLLOWS THE SOURCE by default — a project in a workspace is copied into that SAME workspace, and a personal project stays personal. Pass `workspaceId` to override: a workspace id (from list_workspaces) to place the copy in a specific workspace (you need an edit-capable role there), or null to force the copy into your personal space. If the source lives in a workspace you can only VIEW, the call FAILS rather than silently making a personal copy — get an editor role there, or pass workspaceId:null. (Duplicating a project shared with you from a workspace you're NOT a member of lands in personal, since you can't be placed in that workspace.) The returned `workspaceId` tells you where it went. The user's editor won't auto-refresh — they reload to see the copy in the picker. For several versions of one video (hooks, languages, a sheet's rows), make pages of one project with add_page and duplicate_index. Exporting gives one video per page, and pages have no limit. |
| rename_project | Update a project's human-readable name (shown in the editor's project picker). Pass an empty string to clear the name and fall back to the id. Doesn't touch any layers, animations, or styles — only the picker label. |
| reid_project | Change a project's id LOSSLESSLY — re-keys its JSON, every saved version, and all assets + clips, then deletes the old id. Unlike create_project (clone), version history is preserved. Enforces the id policy: the new id is always a v4 UUID — pass `newId` to choose one, or omit to mint a fresh UUID. A project's `name` (the only user-facing label) is untouched, so the picker/editor are unchanged. The editor won't auto-refresh — reload to see the new id in URLs. |
| delete_project | Permanently delete a project: its JSON, shortlist, versions, uploaded assets, and uploaded clips. Requires edit access — the owner, a workspace editor/admin/owner, or a direct-share editor; anyone else gets the opaque not-found. Deleting the last remaining project is allowed. The user's editor session won't auto-refresh — if they were viewing the deleted project they'll need to reload. |
| save_version | Save a version of the current project state. ALWAYS call this once after each meaningful set of changes you make on the user's behalf — the user flicks between versions to compare or roll back, so an unsaved edit is one they can't easily revisit. Use a short descriptive `name` (e.g. "add slide-in animation"); the user sees this verbatim in the picker. One version per logical change-set, not one per individual tool call. |
| list_versions | List every saved version of a project, newest-first. Returns summaries (id, name, timestamp, source, kind, version_number, cp) — not the inner project JSON. `kind` is `"bookmark"` (deliberate save, gets a v<N> label, partner-pinnable in the <morpha-video> embed) or `"auto"` (editor auto-snapshot every ~10 mutations, restore-only). `version_number` is bookmark-only and stable for the lifetime of that version — deletes leave gaps, numbers never re-shuffle. `cp` names which pages the version changed (comma-joined 8-char page-id prefixes; `"*"` = page order only; absent = unknown, treat as all pages). Use the returned `id` (or `v<version_number>` shorthand) with restore_version / rename_version / delete_version. |
| restore_version | Load a saved version over the live project. Accepts either the version's UUID `id` or the `v<N>` shorthand (e.g. `"v6"` finds the bookmark with version_number=6); auto-snapshots are addressable by UUID only. Without `page_index` this replaces the ENTIRE project (every page) — an auto checkpoint named `before restore: …` is saved first whenever the current state has unsaved changes, so the overwritten state stays recoverable. With `page_index` it restores ONLY that page: the page is matched across versions by its stable id and replaced verbatim (canvas size and name included); other pages are untouched and the write is compare-and-swapped against concurrent edits. Errors if the version predates that page — restore the whole version instead. A restored page may reference assets deleted since the snapshot; those render as missing. An open editor reconciles the result into the live project within a few seconds — no refresh needed. |
| rename_version | Rename a saved version's human-readable label (what the user sees in the picker). The `v<N>` partner-facing identifier is unaffected — only the display name changes. Accepts the version's UUID `id` or the `v<N>` shorthand. Empty / whitespace-only names are rejected. |
| delete_version | Permanently delete one saved version (bookmark or auto-snapshot). Accepts the version's UUID `id` or the `v<N>` shorthand. The bookmark v<N> sequence keeps gaps — numbers never re-shuffle — so any external snippet referencing the deleted `v<N>` will fail to resolve afterwards. Idempotent: deleting a non-existent version is a no-op. |
| upload_image | Upload an image into a project by fetching a public http(s) URL server-side. The target is the URL you pass and nothing else: Morpha's Worker fetches it with a plain HTTP GET, following redirects, and identifies itself as "Morpha/1.0 (+https://morphareels.ai; hello@morphareels.ai)". No third-party API is involved. The worker downloads the .png/.jpg/.jpeg/.gif/.webp/.svg, stores it in the project's asset bucket under a new id, and returns { filename, name, sizeBytes, contentType }: pass the returned `filename` (the file's id, never shown to a person) to add_image_layer, and `name` is what people see. This tool does not search for images: pass a direct image file URL, such as one the person has given you, and respect the licence its source states. The url must be a direct, publicly-fetchable http(s) link (not an auth-walled page). SVGs are rejected if they carry a <script>, an inline event handler, a <foreignObject>, a javascript: URL, or an external resource reference — supply a static, self-contained SVG. Buffered in Worker memory, so capped at 16 MB. For a file on the caller's own disk, use create_upload_link instead. Reference: https://morphareels.ai/docs/tools#uploadimageurl-name |
| upload_audio | Upload an audio track into a project by fetching a public http(s) URL server-side — the ONLY way to get an audio file's bytes into a project over MCP/HTTP (add_audio_overlay / update_audio_overlay only reference a file that is already uploaded). The target is the URL you pass and nothing else: Morpha's Worker fetches it with a plain HTTP GET, following redirects, and identifies itself as "Morpha/1.0 (+https://morphareels.ai; hello@morphareels.ai)". No third-party API is involved. The worker downloads the .mp3/.m4a/.wav/.ogg/.aac, stores it in the project's asset bucket under a new id, and returns { filename, name, sizeBytes, contentType }. Then pass the returned `filename` (the file's id, never shown to a person) to add_audio_overlay (add a second track) or update_audio_overlay { id, filename } (replace an existing track's file — find the id via describe_video's audio_overlays), with `name` as the track's name. The url must be a direct, publicly-fetchable http(s) link (not an auth-walled page). Buffered in Worker memory, so capped at 50 MB. For a file on the caller's own disk, use create_upload_link instead. Reference: https://morphareels.ai/docs/tools#uploadaudiourl-name |
| create_upload_link | Put a file from the caller's own disk into a project: an image (.png/.jpg/.jpeg/.gif/.webp/.svg), an audio track (.mp3/.m4a/.wav/.ogg/.aac) or a font (.woff2/.woff/.ttf/.otf). Returns { uploadUrl, filename, name, command, expiresAt, maxBytes }. Run `command` from a shell (a curl line that PUTs the file's raw bytes to uploadUrl), then pass the returned `filename` (the file's id, never shown to a person) to add_image_layer, add_audio_overlay or set_custom_font. The link takes one file, stored under the id it was minted with, for 15 minutes; a second upload in that window replaces the first. The upload is checked as an editor drag-drop is: size cap (16 MB for an image or font, 50 MB for audio), SVG safety, storage quota. A client with no shell passes a public URL to upload_image or upload_audio instead. A video clip is not taken here, because its preview proxy is built on the caller's machine: use the morphareels-sdk's client.addVideo. Reference: https://morphareels.ai/docs/tools#createuploadlinkname |
| detect_text_regions | Return the OCR text regions detected in a clip's video frames OR a still image asset. Pass either `clip` (a video.<id>.clip filename) or `image` (an image layer's filename) — not both. Video clips are sampled every 0.3s at upload time; images are OCR'd once. Results are cached in R2 next to the source. Returns { status: 'ready' | 'not-ready', frames: [{ frame, time, words: [{ text, x0, y0, x1, y1, confidence }] }], videoWidth, videoHeight }. For an image there's a single frame (frame 0); videoWidth/videoHeight are the image's pixel dimensions. Each `words` entry is one detected text line — `text` may hold several words, the box is axis-aligned, and `confidence` is 0–100. Coordinates are in the SOURCE pixel space (not canvas space). Use to know where titles / subtitles / lower-thirds are baked into the video or image so the Morpha title + intro graphics can be positioned to not collide. |
| safe_zones | Return horizontal 'safe band' y-ranges of the canvas where a clip's burned-in video text (subtitles, lower thirds, titles) does NOT appear, plus the inverse 'text bands' (where it does). Reads the OCR cache built at clip-upload time (see detect_text_regions). Coordinates returned in BOTH source pixels and CANVAS pixels — canvas coords already account for the video layer's fit/anchor/position. Use to lay out captions, titles, callouts so they never collide with the video's own text. This is about the clip's own burned-in text: where TikTok and Instagram Reels cover the canvas with their UI is describe_video's platform_safe_area. Returns { ok: true, status: 'ready' | 'not-ready', data: { bands, safeBands, textBands } }. |
| transcribe_clip | Return the cached transcript of a clip's audio. Generated client-side in the Morpha editor (transformers.js Whisper) and cached in R2 next to the clip; if absent, it is produced when the clip is opened in the editor. Independent of the clip's video codec — runs on the audio track only, so it works on HEVC/AV1 clips that the OCR pipeline can't decode. Returns { ok: true, status: 'ready' | 'not-ready', data: { text, word_count, words: [{ word, start, end }], vtt? } }. |
| clip_processing_status | Report whether a clip — or every video clip in the project, if `clip` is omitted — has been through the browser-side video-processing pipeline: proxy build, audio split, transcription, OCR (text regions). Processing never runs on the server. The preview proxy is mandatory: every processing run builds it (client.addVideo / client.processClip / client.processProject in the morphareels-sdk npm client, which drive local Chrome), and the Morpha editor builds any missing proxy for every page's clip when the project is opened. The other steps run through the same npm client or in the editor. Returns { ok: true, data: { clips: [{ clip, processed, steps: { proxy, audio_split, transcript, text_regions } }], allProcessed } }, where each step is 'ready' | 'pending' | 'running' | 'unavailable' | 'cancelled' | 'error'. 'cancelled' is a transcript the user stopped in the editor: it stays stopped across opens, and only the editor's Re-run starts it again. audio_split stays 'pending' until the user splits the clip's audio into its own track in the editor (Inspector → Audio → Split audio) or the SDK's audio_split step runs; it never gates `processed`, and an unsplit clip plays its own sound. Use it to know whether transcribe_clip / detect_text_regions will return data, and to surface an 'unprocessed' state to the user. |
| render_video | Render the project to an MP4 on Morpha's servers, for an agent that has no browser to drive (a chat app, a Linux box). Returns { renderId, status: 'rendering', next } — call render_status with that renderId after about 30 seconds. THIS COSTS THE ACCOUNT MONEY and needs a subscription: the render is charged to the subscription's credits at Morpha's measured compute cost, so a longer composition and a larger scale both cost more. Two free routes exist and are usually better — give the person the editorUrl every project result carries and they choose Share, then Download (Render MP4 on a phone) in the editor, free and with no watermark; or a script runs the morphareels-sdk npm client's client.renderVideo(projectId) on macOS or Windows. Renders at 2x the canvas by default, the same as the editor and the npm client; pass scale: 1 for the canvas's own size, which is faster and cheaper. The cost is reserved against the subscription's credits before the render starts, so a render is refused up front when the credit to pay for it is not there rather than discovered afterwards; you are then billed the real measured cost, never more than the amount reserved. Refused for a composition longer than 30 minutes, when the remaining credit will not cover it, or while 3 renders are already running for this account. The finished file stays downloadable for 7 days, then it is deleted; the project stays and can be rendered again. The render downloads the project's fonts from their hosts, including a custom font's own URL (set_custom_font). Reference: https://morphareels.ai/docs/tools#rendervideopage-scale |
| render_status | Check a server render started by render_video, and get its download link. Returns { ok: true, status: 'not-ready' } while it is still rendering (wait and call again), or { ok: true, status: 'ready', data: { downloadUrl, editorUrl, expiresAt, videoSeconds, scale, chargedCents } } once the MP4 is ready. `downloadUrl` is a plain https link needing no Morpha account — give it to the person; it stops working when the render is deleted at `expiresAt` (7 days). `chargedCents` is what the render cost the subscription. A render that failed answers ok:false with a plain reason and is never charged. Only the account that started a render can read it. |
| describe_video | Structural OVERVIEW of the composition (the table of contents) — canvas size, duration, platform_safe_area (the part of the canvas TikTok / Reels UI and Instagram's feed crop leave visible: keep text, captions, logos and buttons inside it; null when nothing is covered or cropped), the backdrop summary, and a z-ordered tree (top of stack first) of every layer with its elementId, type, name, type label (filename/clip/text/kind), geometry (x/y/width/height), and which properties are animated. Does NOT include keyframe values or styles — those are unbounded. On a multi-page project the tree describes the ACTIVE page and the data carries a `pages` block ({ page_count, active_index, pages: [{ index, name, has_video }] }) — content tools target that active page; use select_page to switch which page they target, add_page / delete_page / reorder_pages to manage the pages. Start here, then call inspect_layers([elementId, …]) for full detail on the specific layers you'll change. Don't guess keyframe/style values from this overview. |
| inspect_layers | Full per-element drill-in — the 'open this layer' half of the browser. Returns each named element's COMPLETE record: all of its own fields plus its animation tracks (every keyframe), colour/fill tracks, track-loop (extrapolation) modes, and style. Pass the elementIds you read from describe_video; pull detail only for the handful of layers you're about to mutate, not the whole project. |
| move_layer | Set a layer's static base transform. Writes x/y/w/h/rotation directly on image.<id>, video.<id>, and shapes.<id>; for group.<id> sets pivotX/pivotY (no width/height/rotation — use add_keyframe for group rotation). Also sets `scale` and `opacity`, which every layer kind carries. Note: when a layer has a keyframe track for a property, the track OVERRIDES the static value at every frame — use add_keyframe to animate, move_layer to set the un-animated default. A scale/opacity write over an existing track is REFUSED for that reason; pass clear_animation:true to replace the animation with the static value. |
| set_pivot | Set the rotation / scale pivot anchor for an image, video, shape, or text leaf. Picks one of the 9 standard bbox anchors — corners, edge midpoints, or centre — so the layer rotates and scales around that point instead of its centre. The pivot is normalized to the bbox, so resizing the layer keeps the pivot anchored to the same corner / edge / centre. Static (not animated). For groups, use move_layer with x/y to set the group's absolute pivotX/pivotY instead. |
| add_keyframe | Add or overwrite a keyframe on a layer's animation track. For leaves (image/video/shape), x/y/rotation keyframes are ABSOLUTE canvas-space values: x and y are the layer centre's pixel position (canvas is 1080×1920), rotation is degrees. For groups, x/y keyframes are translation offsets applied around the group's frozen pivot, and rotation is the group's absolute angle. scale orbits the layer/pivot centre (1 = no change). opacity is 0..1. 30 fps. When a keyframe track is present on a property, it OVERRIDES the layer's static base value at every frame. |
| set_keyframes_batch | Add or overwrite MANY keyframes across MANY layers in ONE call — functionally equivalent to N add_keyframe calls but with one HTTP/MCP round-trip. Pass an array of entries; each entry has the same fields as add_keyframe. Validated atomically: any invalid entry rejects the whole batch. Use this whenever you'd call add_keyframe more than a couple of times (rippling grids, twinkling starfields, staggered text reveals). |
| add_keyframes | Add many keyframes to ONE element's ONE property in a single call, with an optional loop mode applied in the same call. The idiomatic form when every layer in a multi-element animation gets its own track (ripple dot pulse, snowflake fall, equaliser-bar wave). Factors elementId + property out of the loop body and folds set_track_loop in. Use set_keyframes_batch instead when you need to mix elements/properties in one atomic call. |
| remove_keyframe | Remove the keyframe at frame N on a layer's track. Removing the last keyframe from a track restores the layer's static base value across the timeline. |
| shift_track | Bulk-shift every keyframe's VALUE on one property of one layer by `delta`. Mirrors the 'select all keyframes + nudge layer' gesture in After Effects / Premiere / FCP — preserves the relative spacing of the animation but slides the whole curve. Keyframe TIMES are untouched. Use for 'move all x by -30px' on a complex animation, retiming a fade by adjusting its base opacity, rotating an existing wobble by 10°, etc. |
| set_track_loop | Set the extrapolation mode for one property's animation track. Modes: "hold" (default — holds the boundary keyframe's value past the ends), "loop" (wraps frames past the last keyframe back to the first, restarting the animation), "ping-pong" (alternates direction each cycle, bouncing back and forth), "cycle" (wraps like loop but each cycle adds the boundary delta — used for endless rotation or scrolling). Has no effect on tracks with fewer than 2 keyframes. |
| add_image_layer | Add an image layer. The asset must already be uploaded (the editor's drag-drop, upload_image, create_upload_link, or POST /api/upload-asset/<projectId> with the raw bytes and an X-Upload-Name header). Every upload returns { filename, name }: pass `filename` (the stored file's id) here, and `name` as the layer's label. To duplicate an existing layer, reuse its filename — the editor auto-assigns a fresh id. |
| add_video_layer | Add a video layer. The clip must already be uploaded (the morphareels-sdk's client.addVideo, or the editor). An upload returns { filename, name }: pass `filename` (the stored clip's id) as `clip`, and `name` as the layer's label. To duplicate an existing layer, reuse its clip filename — the editor auto-assigns a fresh id. |
| add_shape | Add a shape layer. `kind` selects the primitive: rect | ellipse | triangle | star | pentagon | hexagon | arrow | heart | rounded-rect | diamond | parallelogram | trapezoid | semicircle | ring | pill | cross | heptagon | octagon | star-4 | star-6 | sparkle | burst | arrow-left | double-arrow | chevron | block-arrow-up | curve | lightning | speech-bubble | location-pin | checkmark | x-mark | shield | cloud | crescent | teardrop | banner. All are native vector shapes; never substitute an image layer for one. Default-positioned in canvas centre if x/y/w/h omitted. |
| add_curve | Draw an editable arrow / curved line — a stroked quadratic bezier with an arrowhead. Specify the two endpoints (x1,y1)→(x2,y2) in canvas pixels; `bend` pushes the midpoint perpendicular (px, 0 = straight line, positive/negative curves either way). `color` #rrggbb, `stroke_width` px, `arrow_head` none|end|both (default end). Use this for callout arrows (e.g. swooping into a link). |
| duplicate_layer | Composition primitive: clone a leaf (image.<id> / video.<id> / shapes.<id> / text.<id>) `count` times, applying a cumulative per-step transform — copy i is offset by i·(dx,dy) px, rotated by i·d_rotation°, and scaled by d_scale^i. One call instead of dozens: a circle of stars (dx/dy + d_rotation), a row of chevrons (dx), a fractal (d_scale<1 + d_rotation), a staggered grid. Styles are copied; animate the result afterwards (e.g. group + a cycle-loop track for endless marching). |
| remove_layer | Delete a video, image, text, or shape LEAF layer. Errors on a group.<id> (dissolve it with ungroup_layers instead) and on a pinned layer such as the canvas backdrop. Deleting a video layer also takes everything welded to that clip: its welded audio overlay(s) and its welded caption lines, both of which derive their timing from the clip's trim and have no meaning without it. |
| reorder_layer | Move a layer within its parent's siblings. newIndex is 0-based among siblings (root list when ungrouped, or the parent group's children when nested). 0 = bottom of that subtree; last = top. |
| set_style | Set style fields on a layer. Only the fields you pass are changed; omit a field to leave it untouched. Covers border/radius/shadow (including borderAlign — inner|center|outer border position) plus image-only fields: fit (stretch|cover|contain), anchorX/anchorY (0..1, where the source anchors when cropping/letterboxing under cover/contain), tintColor (#rrggbb) + tintStrength (0..1) for a colour overlay painted source-atop, and alphaMask (linear gradient — see below) for a multiplicative alpha fade across the layer. |
| set_layer_fill | Set a layer's fill. The canvas backdrop is the pinned is_background image_layer (its element id is exposed via describe_video as background.elementId; the literal 'background.canvas' is also accepted as a synonym); null is rejected on the backdrop. Shapes require a Fill (null/missing is rejected). Image / video / text / group layers accept a Fill object (or `#rrggbb` hex) to paint a backdrop, or `null` to clear it — clearing removes the layer's fill colour keyframes too, so an animated backdrop really does go away. Shapes paint their body; image/video paint behind the bitmap; groups paint a rect centred on the pivot sized by (box_width, box_height). REFUSED on a layer whose fill is ANIMATED (it has colour keyframes): the track wins at every frame, so a plain fill write would be invisible. Change it at a frame with add_color_keyframe, or pass clear_animation:true to replace the animation with this fill. |
| set_text_background | Add or update the rounded background box behind a TEXT layer (text.<id>) in one call — sets the backdrop fill plus the box's padding, corner radius, and optional stroke. Pass only the fields you want to change. New text layers are already text_autofit "hug", so padding alone shrink-wraps the box to the text — ideal for caption / sticker chips; set_layer_text(text_autofit:"hug") is only needed when adding a box to an OLDER layer still on "wrap". THIS IS HOW YOU BUILD A BUTTON: a button / CTA / chip / tag / pill / labelled badge is ONE text layer with a native background, never a rounded-rect shape with a text layer parked on top — padding is what sizes the box around the label, so the two can't drift apart when the text or the scale changes and the user drags one layer instead of two. The one exception: the box is NOT painted on CURVED text (a straight box behind a bent line reads as broken), so an arc-shaped chip genuinely needs a shape behind it. Pass fill null to remove the box. Text layers only; for shapes/images/video use set_layer_fill. |
| set_group_box | Set a group's backdrop rect size. The rect is centred on (pivotX, pivotY) in group-local space and transforms with the group. Either dimension at 0 hides the backdrop entirely. |
| add_color_keyframe | Add or overwrite a colour keyframe on a fill track. Targets a leaf (shapes.<id>, image.<id>, video.<id>, group.<id>). The canvas backdrop is the pinned is_background image_layer (the literal 'background.canvas' is accepted as a synonym for its element id). The value is a Fill — adjacent keyframes crossfade stop-by-stop. 30 fps; frame is 0-indexed. |
| remove_color_keyframe | Remove the colour keyframe at an exact frame on a fill track. No-op when no track or no matching keyframe exists. Removing the last keyframe drops the track entry. |
| fade_layer | Fade a layer's opacity between two frames in one call. |
| set_layer_visible | Show or hide a layer instantly by writing a single opacity keyframe (1 or 0) at frame 0. |
| apply_preset | Apply a canned animation preset to a layer. |
| apply_preset_stagger | Apply the same preset to a LIST of layers with a per-element startFrame offset — one call instead of N apply_preset calls. For diagonal pop-in grids, sequential list reveals, ring-pulse sweeps. The startFrame for entry i is `startFrame + i * stagger`. Order the elementIds in the visual order you want the animation to cascade. |
| group_layers | Wrap sibling elements in a new group. USE THIS whenever several layers are one thing — a butterfly assembled from wings + body + antennae, an icon built from primitives, a card + its title + badge, a lower-third — and name the group what the thing is; a multi-shape object left as loose siblings is a defect the user has to clean up, and the group's name is their only handle on it. The group composes its x/y/scale/rotation/opacity onto its descendants (so one track flies/spins/fades the whole thing) and pivots rotate/scale at its (pivotX, pivotY), seeded to the centroid of its children at create time. The group's x/y track values are translation offsets applied around the pivot — groups have no static body of their own. All listed elementIds must currently share the same parent (root, or one existing group). |
| ungroup_layers | Dissolve a group: its children are spliced into the group's parent at the group's old position. The group's animation tracks are discarded — children survive at their last positions but inherit none of the group's keyframes. |
| set_group_parent | Move an element into a group (or out to root). Refuses to place a group inside its own descendants. |
| rename_group | Rename a group. Pure cosmetic — labels appear in the Inspector and describe_video output. |
| add_to_collection | Add a layer to the user's reusable Collection. Pass ANY element id — a leaf (text.<id>, image.<id>, …) or a whole group.<id> (a lower-third, logo sting, brand intro). It then appears in the user's Collection (list_collection), where they — and, if this project is in a workspace, every teammate — can drop a self-contained COPY of it into any other project (add_from_collection). Copies are IMMUTABLE: adding copies the whole subtree + its asset bytes, so editing or deleting this source never changes a copy already placed elsewhere. Works on solo projects too (a personal Collection). Give the layer a clear name first (rename_layer / rename_group) — that name is what shows in the Collection. |
| remove_from_collection | Remove a layer from the user's Collection so it's no longer offered for reuse. Pass the element id that was added with add_to_collection. Copies already placed in other projects are unaffected (they're self-contained). No-op if the id isn't in the collection. |
| add_morpha_layer | Embed another of the user's projects ("a morpha") inside this one as a version-pinned band. The source's layers are inlined into the host as a collapsible group, re-keyed to fresh ids, pinned to one immutable version of the source. Pass the source project's id as source_morpha_id (and optionally a version label); the server resolves and inlines the pinned version. Editing the band's inner layers only affects THIS video — the change is local and never propagates back to the source. To pin the band to a different saved version, re-pin it from the editor's Inspector. describe_video marks an embedded band with morpha:true + source_morpha_id so you can tell it apart from a plain group. |
| add_audio_overlay | Add an audio overlay (mp3/m4a/wav/ogg) scheduled at a frame-aligned start. The asset must already be uploaded (upload_audio, create_upload_link, or the editor); pass the upload's returned `filename`, and its `name` as the track's label. 30 fps; convert seconds with frames = round(s * 30). Plays in the editor preview and is mixed into the MP4 export. |
| remove_audio_overlay | Delete an audio overlay by id. |
| update_audio_overlay | Patch an existing audio overlay. Only the fields you pass are changed. Pass endFrame:null to clear it (revert to natural-length playback). |
| set_video_layer_trim | Patch a video layer's trim window: source_in_frame (frame in source to start), source_out_frame (frame in source to stop, or null for natural end), timeline_start_frame (where on the project timeline the slice begins). Only the fields you pass are changed. Use this to clip out a segment of a source mp4: duplicate the layer first (in the editor) so you have two pointing at the same clip, then set disjoint source windows. |
| set_layer_block | Set (or replace) a layer's timeline BLOCK — the [start, start+duration) window it exists for. The layer is drawn ONLY inside that window, and its animation keyframes are sampled RELATIVE to the block start, so moving or trimming the block re-anchors its intro instead of leaving it behind. This is how a layer 'starts' at a point like an iMovie clip rather than being present for the whole composition. Works on any leaf or group. Frames are in the layer's parent timeline (composition frames at root; band-local inside an embedded morpha band). To place a whole embedded reel, use move_band. |
| set_layer_transition | Set how a layer ENTERS at the start of its on-timeline window and LEAVES at the end, instead of popping. The transition is EDGE-RELATIVE — only a length and a look are stored — so it rides the edge through every later trim, slide or clip retime. Prefer this over fade_layer / apply_preset whenever the intent is 'enters and leaves nicely': those write opacity keyframes at ABSOLUTE frames, which strand themselves the moment the edge moves, and clutter the timeline lanes. A layer created WITH a `block` is born carrying a short fade at each edge — whether you passed the block or the editor minted one — so check `inspect_layers` before adding one, rather than assuming there is none. Layers created before this default existed, and any edge cleared to "cut", carry nothing and do need setting. A layer with NO block is always-present, has no edges, and a transition on it is inert. Video clips default to a hard cut, because a hard cut between shots is the grammar of short-form video. kind "cut" clears the edge back to a hard cut. The length is a request: when the window is too short to hold both ramps they are squeezed proportionally at render time, and the stored values are left intact. |
| move_band | Place an embedded morpha band on the host timeline: set its TIME ORIGIN (the frame it starts). The band's whole inner reel plays relative to this frame, so its intro animations fire when the band appears instead of at 0:00 (the fix for 'the embedded intro doesn't animate'). Keeps the band's current window length; if it had none, the band spans from start to the composition end. Pass the band group's id (from describe_video — a group with morpha:true). |
| shift_group | MOVE a group and everything inside it along the timeline, keeping its internal timing intact — the 'slide this whole section later' operation. A plain group is a relative CONTAINER: it has no window of its own, so on the timeline it spans the hull of its contents, and moving it slides the whole subtree as one rigid body. `start` is the ABSOLUTE frame the group's window should end up at, not a delta, so calling it twice with the same value is a no-op. Descendants keep their spacing; the move stops when the earliest thing inside reaches frame 0. Welded caption lines are deliberately left behind (they follow their clip's speech, not this group), and an embedded morpha band moves as one unit. Fails when the group is empty or holds an always-present layer — there is no bounded window to move. To CLIP what is shown of a group rather than move it, use set_group_window; for a single layer use set_layer_block. |
| set_group_window | TRIM a group's own visible window — the [start, start+duration) range over which the group and its subtree are drawn. The contents are NOT moved or deleted: this clips what is shown, so use it to hide the head or tail of a whole section. Writing a window overrides the group's derived contents-hull from then on. Two safety corrections apply automatically: the group's OWN keyframes are compensated for the change in start so its animation doesn't jump (reported as keyframesCompensatedBy), and the duration is grown if needed so the window can never hide one of the group's own authored keyframes (reported as grownToCoverKeyframes). To MOVE the group and its contents instead, use shift_group. |
| set_duration | Author an EXPLICIT composition length in seconds, pinning it (duration_authored=true) so the auto-fit no longer drives it. Morpha normally DERIVES the comp length from content (the furthest keyframe / video window / audio end); this overrides that with a fixed length — the stage becomes a fixed canvas you author into, and content past the end is kept but not played or exported. 1-second floor, no ceiling. Use it to shorten a comp to a target length (e.g. a 15-second cut) or to reserve a longer stage than the current content fills. Call fit_duration_to_content to release the pin. |
| fit_duration_to_content | Clear an authored composition length and return to AUTO-FIT — the comp length tracks the furthest content (keyframe / video window / audio end) again, with a 1-second floor. The inverse of set_duration. NOTE: headless (no loaded media) this can UNDER-fit when a video layer's source_out_frame is null — its natural length is unmeasurable, so it contributes only its start frame; the length self-corrects the next time the project is opened in the editor, where the real clip durations are known. |
| cut_range | Ripple-delete a time window [startFrame, endFrame) — remove that span and pull all later content earlier by delta = endFrame - startFrame (the NLE 'ripple delete' / 'close gap'). Shifts every keyframe, colour keyframe, marker, audio overlay, loop region, and start_at through the cut (a speed ramp is anchored to its clip and rides along unchanged), and is SOURCE-AWARE for video layers: a clip that straddles the cut is trimmed, and one whose interior is removed is SPLIT into two layers. Audio overlays interior to the cut are truncated at the seam (overlays have no source-in to bridge the gap). REFUSES to cut across a video layer that carries speed-ramp keyframes — remove them, or cut outside that layer's span, first. The composition length shrinks accordingly (an authored length loses only the overlap with its visible region). Frames are 0-indexed project-timeline frames at 30 fps; endFrame is exclusive and clamped to the composition length. |
| set_embed_origins | Replace the project's embed allowlist — the hostnames permitted to load this project through the public <morpha-video> embed. Pass the full desired list; it overwrites the previous one. An empty array turns embedding OFF (the public embed endpoint 404s the project). Each entry is normalized to a bare lowercased hostname (scheme, port, and path stripped, e.g. "https://example.com/x" → "example.com"); duplicates are dropped. Morpha sends the listed websites no request: the list decides which of them may load the project, so any page on an allowed host can show it. The embed serves only saved bookmarks (save_version), never unsaved edits, and leaves out who the project is shared with. Reference: https://morphareels.ai/docs/tools#setembedoriginsorigins |
| add_embed_origin | Add one hostname to the project's embed allowlist (the hostnames permitted to load the public <morpha-video> embed). Idempotent — re-adding an existing entry is a no-op. The origin is normalized to a bare lowercased hostname (scheme/port/path stripped). Morpha sends that website no request; any page on it may then load the project. Reference: https://morphareels.ai/docs/tools#addembedoriginorigin |
| remove_embed_origin | Remove one hostname from the project's embed allowlist. Idempotent — removing an entry that isn't present is a no-op. Removing the last entry turns embedding OFF (the public embed endpoint 404s the project). Morpha sends that website no request; a page on it stops loading the project. Reference: https://morphareels.ai/docs/tools#removeembedoriginorigin |
| set_custom_font | Register a typeface Morpha does NOT ship, so text layers can use it by family name via font_family (exactly like a built-in family). Families already in the built-in catalogs (anything list_fonts returns from google/bunny/fontshare/fontsource/velvetyne) are REJECTED — they need no registration; just set font_family to them directly. `src` is EITHER a full URL (https://…) OR a font file already uploaded to the project's asset bucket (create_upload_link, or POST /api/upload-asset/<projectId> with raw bytes + an X-Upload-Name header; .woff2/.woff/.ttf/.otf): pass the filename the upload returned. Like add_image_layer, this does NOT verify an uploaded filename exists. Dedupes by family+weight+style, replacing a matching face. After registering, set a text layer's font_family to this family (add_text_layer / set_layer_text). NOTE: a pasted URL only loads if that host sends permissive CORS headers — uploading the font (served same-origin) is the robust path. A URL is not fetched when this tool runs: Morpha's renderer and every browser that opens the project download it later. Reference: https://morphareels.ai/docs/tools#setcustomfontfamily-src-weight-style |
| list_fonts | List available font families across every source the editor knows about (Google + Bunny + Fontshare + Fontsource + Velvetyne) PLUS the project's user-uploaded custom_fonts (surfaced as source: "custom"). Use this to discover families before set_layer_text / add_text_layer when you don't know what to pick. Returns { fonts: [{family, source, weights, italics}], total, returned, sources }. Filter via `q` (case-insensitive substring on family) and/or `source`; cap with `limit` (default 50, max 1000). Picking any returned family in font_family Just Works — the editor's loader dispatches to the right CSS/FontFace endpoint by source. |
| set_layer_text | Edit an existing text layer (text.<id>). Patches its text content, font, size, colour, and full type styling — pass only the fields you want to change. Does NOT create layers and does NOT touch image layers; use add_text_layer to make a new one. `font_family` is a Google Fonts family name (e.g. "Anton", "Bebas Neue"). `text_size` is the font size in px (omit to keep the current size). `text_color` is #rrggbb. Styling: font_weight (100-900, e.g. 800 for a black/heavy logo look), font_style (italic), text_transform (uppercase/lowercase), letter_spacing (px, may be negative for tight tracking), line_height (multiplier), text_align, text_autofit ("wrap" default = fixed size + word-wrap, the size you set is what renders; "fit"=auto-size to fill the box, grows and shrinks; "shrink"=legacy shrink-only), text_valign (top/middle/bottom block alignment), an outline via stroke_width + stroke_color, and a text_shadow. To make text MASK another layer (video/image-filled letterforms) use set_matte_source with this layer's id as the matte source. Only `elementId` is required. |
| add_text_layer | Create a new text layer — a first-class leaf that animates, groups, and z-orders exactly like an image or shape. The renderer draws live typeset text (multi-line, auto-fit to the box). Defaults: x/y = canvas centre, width 900, height 320, font_family "Hanken Grotesk", text_size derived from existing text layers (or ~10% of canvas height). Also accepts full type styling: font_weight (100-900), font_style (italic), text_transform, letter_spacing, line_height, text_align, text_autofit ("hug" default = box shrink-wraps the text at the fixed text_size, honouring literal newlines, so it can't re-wrap between preview and export — bake your own "\n" line breaks / "wrap"=fixed size + word-wrap to the box / "fit"=auto-size to fill the box, grows and shrinks / "shrink"=legacy shrink-only), text_valign (top/middle/bottom), an outline (stroke_width + stroke_color), and text_shadow. Returns the new layer's id + element id (text.<id>). |
| add_caption_track | Build a caption track from pre-timed lines (e.g. derived from transcribe_clip's word timings). mode "line-sync" (default) creates one text layer per line, each shown only during its [startFrame, endFrame) window via hold-eased opacity keyframes — the active-line karaoke read; mode "static" makes a single layer with all lines joined. `style` picks a preset look. Lines default to a lower-third band. The caption layers are always wrapped in a "captions" group so they don't clutter the layers list. Returns the created text element ids plus `groupElementId` (the captions group). |
| split_caption_line | Split one caption line into two at a COMPOSITION frame strictly inside its window (in the editor this is the playhead). The right half is a full clone — style, band geometry, weld — and the text divides at the word gap nearest the split point (a single-word line keeps its text on the left; the right half starts empty). A welded line stays welded on both halves (the frame converts to the clip's source timeline); a standalone line splits its block. Returns { left, right, splitFrame }. Retime the halves afterwards with set_layer_block; fix the wording with set_layer_text. |
| merge_caption_lines | Merge two or more caption lines into one. The earliest line survives with the union window and the time-ordered texts joined by spaces; the others are removed. All lines must share one flavour — every one welded to the SAME clip, or every one standalone — and no other caption line on that track may sit inside the merged span (move or include it first). |
| rename_layer | Set the human-readable name of a video / image / shape / text layer — the label shown in the Inspector, and the basis for the layer's auto-derived <morpha-video> embed attribute (so renaming a layer to "caption" makes the embed attribute `caption`). Pass an empty string to clear the name. For groups use rename_group. |
| set_loop | Set the project's loop section: the whole composition repeats once per value, with one field of one layer varying across the repeats. Builds one pass per value, each setting `field` of `elementId` to that value — e.g. a caption text layer cycling through several strings. Pass an empty `values` array to clear the loop (the comp plays once). |
| set_canvas_size | Resize the ACTIVE page's canvas to width × height pixels. The composition is scaled UNIFORMLY to fit the new frame (a single factor s = min(newW/oldW, newH/oldH), so nothing distorts — a circle stays a circle) and then re-centred so the old composition centre maps to the new canvas centre. Every layer's position, size, group pivots, and x/y/width/height keyframes follow this fit+recentre; same-aspect resizes scale exactly, aspect changes letterbox the content centred. Each page owns its size, so this leaves sibling pages untouched — select_page then set_canvas_size again to resize another one. Common sizes: 1080×1920 (9:16 Reels/TikTok/Shorts), 1080×1350 (4:5 Instagram), 1080×1080 (1:1 square), 1920×1080 (16:9 YouTube). |
| set_image_filename | Repoint an existing image layer at a different uploaded asset — keeps the layer's id, position, size, animations, and styles; only the bitmap changes. The asset must already exist at users/<userId>/assets/<projectId>/<filename> (the editor's drag-drop, upload_image, create_upload_link, or POST /api/upload-asset/<projectId> with the raw bytes and an X-Upload-Name header); pass the `filename` the upload returned, and its `name` as the label. Use this to swap a layer's image WITHOUT losing its keyframes — `remove_layer` + `add_image_layer` would mint a new id and drop the animations. |
| set_video_clip | Repoint an existing video layer at a different uploaded clip — keeps the layer's id, position, size, animations, styles, and trim window; only the source mp4 changes. The clip must already be uploaded (the editor's Add video, or the morphareels-sdk's client.addVideo); pass the `filename` the upload returned, and its `name` as the label. Use this to swap a video layer's source WITHOUT losing its keyframes. |
| set_matte_source | Set (or clear) a track matte — the host shows only where the matte source is opaque. The HOST can be a leaf (image.<id>, video.<id>, shapes.<id>, text.<id>) OR a group.<id> (a group is a layer of sorts): a group host clips ALL its composited children to the source shape's path — e.g. a marching chevron strip + black backing shown only inside an arrow / band shape. For a leaf host the source can be any leaf (use a text.<id> source for video-/image-filled letterforms); for a group host the source must be a shape (shapes.<id>). The source is CONSUMED: it stops painting as a layer of its own, so do NOT hide it or set its opacity to 0 (an invisible stencil empties the mask and the host vanishes). It has no time window of its own: it follows the host's, and attaching drops its block and edge transitions (`source_window_dropped` in the result). Its position, scale, rotation and keyframes shape the mask. Pass null to clear. |
| freeze_frame | Freeze the picture at a frame: the clip is CUT there and a still of that frame is inserted between the halves, pushing everything after it later (the NLE 'frame hold'). This is how you hold a moment — play, freeze, continue. The still is an ordinary IMAGE layer showing that frame for `holdFrames` (default 150 = 5s at 30fps), so you resize, split, move or delete it like any other layer. `image` is the filename of a PNG of that frame, already uploaded to the project's assets — rendering one needs a browser, so capture and upload it first. The reply's `frozenSourceFrame` is the SOURCE frame that was frozen, which differs from `frame` on a retimed clip. `frame` must be strictly inside the clip. |
| set_clip_speed | Play a clip slower or faster at a CONSTANT rate — the normal way to retime a clip. 1 = source speed, 0.5 = half speed, 2 = double speed; range [0.1, 8]. The trim is unchanged, so the clip's length on the timeline changes to suit: at 0.5x it occupies twice as many frames, at 2x half as many. Audio is time-stretched with pitch preserved. Use add_speed_keyframe instead only when the rate must CHANGE over the clip (a ramp). |
| add_speed_keyframe | Add or overwrite a speed-ramp (time-remap) keyframe on a video layer, for a rate that CHANGES over the clip. `frame` is a PROJECT-timeline frame and must sit on the clip (at or after its timeline_start_frame); the curve itself is anchored to the clip, so moving the clip carries the ramp with it and never changes its duration. For a constant slower/faster clip use set_clip_speed instead. `rate` is the playback rate at `frame`: 1 = real-time, 0.5 = half-speed, 2 = double-speed. Range: rate in [0.1, 8]. The ramp multiplies the layer's constant speed, and the clip's timeline length is derived from the resulting curve. |
| remove_speed_keyframe | Remove the speed-ramp keyframe at `frame` (a PROJECT-timeline frame — the same value add_speed_keyframe and inspect_layers report) on a video layer. Removing the last keyframe clears the speed_keyframes array entirely (restoring 1× playback). |
| set_video_layer_muted | Mute or unmute a video layer's baked audio (silenced in both preview and export). The processing pipeline's audio-split step sets this true after demuxing the clip's audio into a standalone overlay track (NLE-style linked A/V), so the source audio doesn't double with the overlay. Pass muted:false to restore the baked audio. |
| add_page | Append a page to the project — works on any project, turning a single-page video into a multi-page one. Without duplicate_index a blank page is appended, sized to the project's canvas. With duplicate_index the page at that position is deep-copied (a fresh id is minted). There is no limit on page count. The new page becomes the active page; its index is returned. For several versions of one video (hooks, languages, a sheet's rows), make pages of one project with add_page and duplicate_index. Exporting gives one video per page, and pages have no limit. To edit the copies, select_page each one and describe_video for its element ids; to export them, use the editor's Videos option or renderVideo with page. |
| delete_page | Remove the page at `index`. Fails on an out-of-range index or when only one page remains — a project must keep at least one page. The active page stays active; when the active page itself is deleted, active_index falls to the neighbouring page (the one that slid into its position, or the new last page). |
| reorder_pages | Move a page from `from_index` to `to_index`. The remaining pages shift to fill the gap; active_index is rewritten so it keeps pointing at the same page it did before the move. Fails on out-of-range indices. |
| select_page | Switch which page is ACTIVE — the page the content tools target. Subsequent describe_video / inspect_layers / all content tools read and write this page until the active page changes again. Pages are addressed by 0-based index from describe_video's pages block. Selecting the already-active page is a harmless no-op; fails on an out-of-range index. |