Skip to main content
Glama

create_motion_graphic_from_code

Read create-motion-graphics Skill first.

Create a new Motion Graphic asset from inline React/JSX code supplied in this tool call.

For captions use edit_captions action="renderer" with code/properties; read useSpecialEffects().caption_v1.

JSX: const Component = ({item}) => {...}. Only functions at top level; keep constants inside. Read item.props; globals directly, not Remotion.*. No useItem().

For direct-authored MGs, choose a visual mechanism for the edit. Before a batch, name each MG's viewer job. Reuse only an intentionally recurring component with the same editorial job, information structure and visual form; otherwise share palette/type/motion across separate assets. Text/custom style alone is not batch permission: create one representative MG for user approval. Compare composed settled frames side by side; repeated surfaces/anchors/rhythms must serve a recurring viewer job.

Complete entrance, hold and exit motion within the intended timeline span.

Size: width/height define the natural box around visible content. No transparent timeline-sized wrapper for overlay placement; timeline dimensions are for full-frame MGs only. Place/scale with edit_item.

Fonts: only exact search_fonts family names; machine fonts (Arial, Comic Sans MS, PingFang SC) fail cloud export.

Web 3D (not Desktop): use injected Remotion ThreeCanvas with explicit width/height, THREE math/material constants and supported Drei helpers; no imports. Read the create-motion-graphics Three.js reference for helpers and lighting/camera recipes. useGLTF needs a stable public ChatCut S3 HTTPS model URL; prefer self-contained GLB with CORS. No temporary/signed URLs or local paths. Drive all motion, including camera/model animation, with useCurrentFrame()/fps; never useFrame, clocks, controls or timers.

Public-safe: no repo/local files, attachment paths, servers, or backend paths. Creates the asset only; patch existing MGs with edit_asset inline json.code.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "code": "<code>",
      "height": "<height>",
      "name": "<name>",
      "width": "<width>"
    },
    "name": "create_motion_graphic_from_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesInline pure JavaScript/JSX, no imports/exports or file path. Exactly one top-level const Component = ({item}) => {...}; only component/helper functions at top level. Keep constants, runtime lookups and scene resources inside functions; memoize resources with React.useMemo. Read editable values from item.props. Call injected useCurrentFrame(), useVideoConfig(), interpolate(), spring() and ThreeCanvas directly, never Remotion.*. React hooks use React.useMemo/React.useEffect; there is no useItem(). No window/global.
nameYesAsset display name.
widthYesMotion Graphic natural box width in pixels.
heightYesMotion Graphic natural box height in pixels.
projectIdNoProject for this call (full ID or unambiguous prefix). Explicit-timeline calls never change the target of later calls; legacy project selection applies otherwise.
propertiesNoEditable Motion Graphic properties: objects with key, label, type, defaultValue. Use a provided or approved image of a subject (character, product, logo or photo) as an image property whose defaultValue is that asset instead of redrawing it; if it cannot be used as is, tell the user first.
timelineIdNo
descriptionNo
renderContractNoOptional legacy hint. Shared web validation grants the stamp; this value is not required and cannot bypass validation.
durationInFramesNoMotion Graphic duration in active-timeline frames. Mutually exclusive with durationInSeconds.
durationInSecondsNoMotion Graphic duration in seconds. Mutually exclusive with durationInFrames.
chatcutSpecialEffectUsedNoOptional Web-only media-analysis declarations. Omit for ordinary MG/effect/caption work and preserve existing values on unrelated revisions. Transitions and Desktop do not support these readers. caption_v1 is private to caption-owned code.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedInput schema / properties / properties / description
      Previous value: -"Editable Motion Graphic properties: objects with key, label, type, defaultValue."New value: +"Editable Motion Graphic properties: objects with key, label, type, defaultValue. Use a provided or approved image of a subject (character, product, logo or photo) as an image property whose defaultValue is that asset instead of redrawing it; if it cannot be used as is, tell the user first."
  2. First observed

TDQS

A4.3/5.0
Behavior3/5

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

Goes well past the annotations by disclosing runtime/validation behavior: the cloud-export font constraint, Web-only ThreeCanvas/Three.js support, no imports or useFrame, and the public-safe rule banning repo/local/attachment paths. What it does not cover is the response shape or timing (e.g. whether creation is synchronous, what identifier is returned for later edit_asset calls). Annotations already declare non-destructive, non-open-world behavior, so a 3 fits a description that adds real context but leaves the post-call contract implicit.

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

Conciseness3/5

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

Front-loads the skill prerequisite and the core action, but the body is a dense block of constraints with no grouping, mixing tool-level facts (code contract, sizing, fonts) with editorial guidance about viewer jobs and comparing settled frames that belongs in the linked Skill. Little filler, but the batch-authoring material dilutes scanability for an agent deciding how to invoke the call.

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 12-parameter code-generation tool with no output schema, it covers the code contract, the JSX entry-point shape, timing (useCurrentFrame/fps), sizing semantics, font validity, 3D limitations, and the create-vs-edit lifecycle. An agent has enough to author a valid call without consulting another source beyond the Skill it names.

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 83%, so the baseline is 3; the description clears that bar by giving genuine meaning to width/height ('natural box around visible content… no transparent timeline-sized wrapper for overlay placement; timeline dimensions are for full-frame MGs only'), which the schema only calls pixel dimensions. It adds nothing specific about durationInFrames/durationInSeconds, projectId, or the properties array beyond what the schema already documents.

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

Purpose5/5

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

Opens with a specific verb+resource+mechanism: 'Create a new Motion Graphic asset from inline React/JSX code supplied in this tool call.' It explicitly separates creation from update ('patch existing MGs with edit_asset inline json.code') and routes caption work to edit_captions, so an agent can distinguish it from the nearest siblings without opening a schema.

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

Usage Guidelines5/5

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

Gives explicit when-to-use and when-not-to-use: read the create-motion-graphics Skill first, use edit_captions action="renderer" for captions, use edit_asset for patching, and only call this for new assets. It also states the batch condition (one representative MG for user approval; reuse only with the same editorial job) rather than leaving it to inference.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.