Skip to main content
Glama

Generate AI media (image or animation)

generate_media

Generate an AI image or canvas-code-based animation directly into a clip.

  • kind="image": text-to-image. Pass prompt. Optional: animation_setting (entry/exit — set it HERE, see below), style_id (from find type='image_gen_style_packs'), reference_image_url or mcp_upload_id for image-to-image grounding.

  • kind="animation": canvas-code animation rendered from a prompt. Pass prompt. Optional: voiceover_text (drives timing), base_component_id (reuse a saved animation as the starting point), reference_image_url or mcp_upload_id for visual grounding.

Generation is asynchronous: the element is created immediately with a stable element_id and rendered in the background. Poll get_clip(select:['busy']) — an EMPTY busy means the render has landed. (This previously said to watch the phantom flag; phantom has never been a key get_clip returns, so there was nothing to poll.)

Set presentation up front. animation_setting is applied to the element as it is created, so the image enters correctly the first time it renders. Doing it afterwards with update_elements means writing to the element that is still generating, which is the write most likely to be refused while the generation holds it.

group is NOT accepted here, unlike add_elements: a generated element is built in the background, and the grouping would be overwritten when the render lands. Add it ungrouped, then call update_elements with group once it appears.

Tip: use this tool whenever the user asks for a "generated", "AI", or "create me a" visual. For uploaded photos / logos / icons / GIFs, use add_elements with element_type='image' and a src or mcp_upload_id instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYesTop-left X in canvas pixels.
yYesTop-left Y in canvas pixels.
kindYes'image' = AI text-to-image; 'animation' = canvas-code-based motion graphic.
modelNoImage only. Which image model renders it. Default `gemini-3-pro-image-preview` (Nano Banana Pro), a strong general choice — leave it off unless you want one of the specifics below. `gemini-3.1-flash-image-preview` (Nano Banana 2) and `gemini-2.5-flash-image` are faster and cheaper. `gpt-image-2.5-flare` is OpenAI's fast one, `gpt-image-2.5-sunburst` its most precise editor, and `gpt-image-2` is the one to reach for when the image must carry legible text or follow several reference images. `gpt-image-1` / `gpt-image-1.5` are the older pair and only accept square-ish framing — a wide box is snapped to 4:3 rather than honoured, so do not pick them for a banner. An unlisted value is rejected here rather than silently swapped for the default, which is what the backend does with one.
widthYesWidth in pixels.
heightYesHeight in pixels.
promptYesGeneration prompt. For animations, be SPECIFIC: name the UI elements, interaction sequence, timing feel, and visual style. Vague prompts produce bad output.
clip_idYesClip ID to place the generated element into.
end_timeNoDisappear at (seconds).
style_idNoImage only. Style preset ID from find(type='image_gen_style_packs'). See resource clueso://docs/generation-styles.
backgroundNoImage only, and only honoured by `gpt-image-2.5-flare`, `gpt-image-2.5-sunburst`, `gpt-image-1` and `gpt-image-1.5` — every other model is always opaque and ignores this. Pass `false` for a cut-out with no background: icons, logos, stickers, anything meant to sit ON the composition rather than behind it. You MUST set `model` to one of those four in the same call; `gpt-image-2.5-flare` is the one to default to, since the older pair cannot frame wide. Asking for transparency in the PROMPT instead does not work — the model paints a grey-and-white checkerboard as real pixels.
project_idYesProject ID.
start_timeNoAppear at (seconds).
aspect_ratioNoImage only. Overrides the ratio inferred from width/height. Leave it off and the box decides, which is usually what you want — set it when the box is a placeholder and you know the shape you need. Still clamped to what the model accepts: gpt-image-1/1.5 only do 1:1, 4:3 and 3:4; the gpt-image-2.5 pair adds 16:9 and 9:16; gpt-image-2 has no 3:2 or 2:3, so those become 4:3 and 3:4. The response does not report the ratio used.
mcp_upload_idNomcp_upload_id from the upload flow. Resolved server-side to a presigned URL before generation.
voiceover_textNoAnimation only. Paces the motion to the spoken script — and as a side effect sets this clip's voiceover text and triggers speech generation for the clip.
animation_settingNoImage only. Entry/exit animation, same shape as add_elements' type_data.animation_setting. The design guide asks AI images to enter with `masked_reveal` or a slow fade, so set it here rather than following up with update_elements — that follow-up targets the element while it is still generating. Ignored for kind='animation', which animates through its generated code.
base_component_idNoAnimation only. Reuse a saved animation component as the starting point (from find(type='element_components')). To re-skin its tunable parameters, set parameter_values via update_elements after it renders.
reference_image_urlNoPublic URL of a reference image. Mutually exclusive with mcp_upload_id.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • addedInput schema / additionalProperties
      Added value: +{}
    • removedInput schema / properties / animation_setting / properties / entry / properties / duration_per_unit_ms / exclusiveMinimum
      Removed value: -0
    • addedInput schema / properties / animation_setting / properties / entry / properties / duration_per_unit_ms / minimum
      Added value: +0
    • removedInput schema / properties / animation_setting / properties / exit / properties / duration_per_unit_ms / exclusiveMinimum
      Removed value: -0
    • addedInput schema / properties / animation_setting / properties / exit / properties / duration_per_unit_ms / minimum
      Added value: +0
    • addedInput schema / properties / aspect_ratio
      Added value: +{
      +  "description": "Image only. Overrides the ratio inferred from width/height. Leave it off and the box decides, which is usually what you want — set it when the box is a placeholder and you know the shape you need. Still clamped to what the model accepts: gpt-image-1/1.5 only do 1:1, 4:3 and 3:4; the gpt-image-2.5 pair adds 16:9 and 9:16; gpt-image-2 has no 3:2 or 2:3, so those become 4:3 and 3:4. The response does not report the ratio used.",
      +  "enum": [
      +    "1:1",
      +    "4:3",
      +    "3:4",
      +    "16:9",
      +    "9:16",
      +    "3:2",
      +    "2:3"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / background / description
      Previous value: -"Image only, and only honoured by `gpt-image-2.5-flare`, `gpt-image-2.5-sunburst`, `gpt-image-1` and `gpt-image-1.5` — every other model is always opaque and ignores this. Pass `false` for a cut-out with no background: icons, logos, stickers, anything meant to sit ON the composition rather than behind it. You MUST set `model` to one of those four in the same call; `gpt-image-2.5-flare` is the one to default to, since the older pair cannot frame wide."New value: +"Image only, and only honoured by `gpt-image-2.5-flare`, `gpt-image-2.5-sunburst`, `gpt-image-1` and `gpt-image-1.5` — every other model is always opaque and ignores this. Pass `false` for a cut-out with no background: icons, logos, stickers, anything meant to sit ON the composition rather than behind it. You MUST set `model` to one of those four in the same call; `gpt-image-2.5-flare` is the one to default to, since the older pair cannot frame wide. Asking for transparency in the PROMPT instead does not work — the model paints a grey-and-white checkerboard as real pixels."
  2. Changed4 schema fields changed
    • removedInput schema / properties / context
      Removed value: -{
      -  "description": "Explain in 15-25 words, in third person, why this tool is called and how it supports the user's goal. For analytics only. You MUST describe only the abstract purpose of the tool call. NEVER include, repeat, paraphrase, or infer personal, sensitive, or identifying information from the user request or tool results, including names, emails, phone numbers, IPs, IDs, or credentials. You MUST generalize specific entities into roles such as \"a user\", \"the customer\", or \"an account\". Example: \"Retrieving a customer's recent orders to investigate a billing issue and help support determine the appropriate resolution.\"",
      -  "type": "string"
      -}
    • removedInput schema / properties / conversation_id
      Removed value: -{
      -  "description": "Echo the conversation_id from the server's previous response. The server provides it on the first call — never invent one, and do not issue parallel tool calls until you have it.",
      -  "type": "string"
      -}
    • removedInput schema / properties / llm_model
      Removed value: -{
      -  "description": "The exact model identifier you (the assistant) are running as, taken from your system prompt or environment (e.g. \"claude-opus-4-8\", \"gpt-5.2\"). Used for analytics only. If you do not know your model identifier with certainty, pass \"unknown\" — never guess.",
      -  "type": "string"
      -}
    • changedInput schema / required
      Previous value: -[
      -  "kind",
      -  "project_id",
      -  "clip_id",
      -  "prompt",
      -  "x",
      -  "y",
      -  "width",
      -  "height",
      -  "context",
      -  "llm_model"
      -]New value: +[
      +  "kind",
      +  "project_id",
      +  "clip_id",
      +  "prompt",
      +  "x",
      +  "y",
      +  "width",
      +  "height"
      +]
  3. Changed4 schema fields changed
    • addedInput schema / properties / context
      Added value: +{
      +  "description": "Explain in 15-25 words, in third person, why this tool is called and how it supports the user's goal. For analytics only. You MUST describe only the abstract purpose of the tool call. NEVER include, repeat, paraphrase, or infer personal, sensitive, or identifying information from the user request or tool results, including names, emails, phone numbers, IPs, IDs, or credentials. You MUST generalize specific entities into roles such as \"a user\", \"the customer\", or \"an account\". Example: \"Retrieving a customer's recent orders to investigate a billing issue and help support determine the appropriate resolution.\"",
      +  "type": "string"
      +}
    • addedInput schema / properties / conversation_id
      Added value: +{
      +  "description": "Echo the conversation_id from the server's previous response. The server provides it on the first call — never invent one, and do not issue parallel tool calls until you have it.",
      +  "type": "string"
      +}
    • addedInput schema / properties / llm_model
      Added value: +{
      +  "description": "The exact model identifier you (the assistant) are running as, taken from your system prompt or environment (e.g. \"claude-opus-4-8\", \"gpt-5.2\"). Used for analytics only. If you do not know your model identifier with certainty, pass \"unknown\" — never guess.",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "kind",
      -  "project_id",
      -  "clip_id",
      -  "prompt",
      -  "x",
      -  "y",
      -  "width",
      -  "height"
      -]New value: +[
      +  "kind",
      +  "project_id",
      +  "clip_id",
      +  "prompt",
      +  "x",
      +  "y",
      +  "width",
      +  "height",
      +  "context",
      +  "llm_model"
      +]
  4. Changed5 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"
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / animation_setting
      Added value: +{
      +  "description": "Image only. Entry/exit animation, same shape as add_elements' type_data.animation_setting. The design guide asks AI images to enter with `masked_reveal` or a slow fade, so set it here rather than following up with update_elements — that follow-up targets the element while it is still generating. Ignored for kind='animation', which animates through its generated code.",
      +  "properties": {
      +    "entry": {
      +      "description": "Entry (appear) animation phase.",
      +      "properties": {
      +        "apply_to_unit": {
      +          "description": "Granularity. 'typewriter' is restricted to 'char'.",
      +          "enum": [
      +            "char",
      +            "word",
      +            "line",
      +            "box"
      +          ],
      +          "type": "string"
      +        },
      +        "direction": {
      +          "description": "Slide direction for this phase. Ignored by fade/scale/pop/typewriter; pass 'none' when the preset has no direction.",
      +          "enum": [
      +            "left",
      +            "right",
      +            "top",
      +            "bottom",
      +            "center_all",
      +            "center_vertically",
      +            "center_horizontally",
      +            "none"
      +          ],
      +          "type": "string"
      +        },
      +        "duration_per_unit_ms": {
      +          "description": "NAME IS MISLEADING — this is the TOTAL duration of the phase in ms (NOT per unit). The renderer splits it across all N units with ~50% overlap. For a perceptible per-unit rhythm scale UP with the unit count (e.g. typewriter on N chars ≈ N × 100–200 ms). For applyToUnit='box' it's just the phase duration. Omit it and you get 400ms, the same default the editor creates with.",
      +          "exclusiveMinimum": 0,
      +          "type": "number"
      +        },
      +        "preset": {
      +          "description": "Preset for this phase. 'typewriter' is char-only and has no direction.",
      +          "enum": [
      +            "slide",
      +            "fade",
      +            "pop",
      +            "scale",
      +            "masked_reveal",
      +            "typewriter",
      +            "none"
      +          ],
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "exit": {
      +      "description": "Exit (disappear) animation phase.",
      +      "properties": {
      +        "apply_to_unit": {
      +          "description": "Granularity. 'typewriter' is restricted to 'char'.",
      +          "enum": [
      +            "char",
      +            "word",
      +            "line",
      +            "box"
      +          ],
      +          "type": "string"
      +        },
      +        "direction": {
      +          "description": "Slide direction for this phase. Ignored by fade/scale/pop/typewriter; pass 'none' when the preset has no direction.",
      +          "enum": [
      +            "left",
      +            "right",
      +            "top",
      +            "bottom",
      +            "center_all",
      +            "center_vertically",
      +            "center_horizontally",
      +            "none"
      +          ],
      +          "type": "string"
      +        },
      +        "duration_per_unit_ms": {
      +          "description": "NAME IS MISLEADING — this is the TOTAL duration of the phase in ms (NOT per unit). The renderer splits it across all N units with ~50% overlap. For a perceptible per-unit rhythm scale UP with the unit count (e.g. typewriter on N chars ≈ N × 100–200 ms). For applyToUnit='box' it's just the phase duration. Omit it and you get 400ms, the same default the editor creates with.",
      +          "exclusiveMinimum": 0,
      +          "type": "number"
      +        },
      +        "preset": {
      +          "description": "Preset for this phase. 'typewriter' is char-only and has no direction.",
      +          "enum": [
      +            "slide",
      +            "fade",
      +            "pop",
      +            "scale",
      +            "masked_reveal",
      +            "typewriter",
      +            "none"
      +          ],
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    }
      +  },
      +  "type": "object"
      +}
    • addedInput schema / properties / background
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "boolean"
      +    },
      +    {
      +      "enum": [
      +        "0",
      +        "1",
      +        "true",
      +        "false",
      +        "yes",
      +        "no"
      +      ],
      +      "type": "string"
      +    }
      +  ],
      +  "description": "Image only, and only honoured by `gpt-image-2.5-flare`, `gpt-image-2.5-sunburst`, `gpt-image-1` and `gpt-image-1.5` — every other model is always opaque and ignores this. Pass `false` for a cut-out with no background: icons, logos, stickers, anything meant to sit ON the composition rather than behind it. You MUST set `model` to one of those four in the same call; `gpt-image-2.5-flare` is the one to default to, since the older pair cannot frame wide."
      +}
    • addedInput schema / properties / model
      Added value: +{
      +  "description": "Image only. Which image model renders it. Default `gemini-3-pro-image-preview` (Nano Banana Pro), a strong general choice — leave it off unless you want one of the specifics below. `gemini-3.1-flash-image-preview` (Nano Banana 2) and `gemini-2.5-flash-image` are faster and cheaper. `gpt-image-2.5-flare` is OpenAI's fast one, `gpt-image-2.5-sunburst` its most precise editor, and `gpt-image-2` is the one to reach for when the image must carry legible text or follow several reference images. `gpt-image-1` / `gpt-image-1.5` are the older pair and only accept square-ish framing — a wide box is snapped to 4:3 rather than honoured, so do not pick them for a banner. An unlisted value is rejected here rather than silently swapped for the default, which is what the backend does with one.",
      +  "enum": [
      +    "gemini-3-pro-image-preview",
      +    "gemini-3.1-flash-image-preview",
      +    "gemini-2.5-flash-image",
      +    "gpt-image-2.5-flare",
      +    "gpt-image-2.5-sunburst",
      +    "gpt-image-2",
      +    "gpt-image-1.5",
      +    "gpt-image-1"
      +  ],
      +  "type": "string"
      +}
  5. First observed

TDQS

A5/5.0
Behavior5/5

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

The description clearly discloses that generation is asynchronous, that the element is created immediately with a stable element_id, and that the caller should poll get_clip(select:['busy']) until it is empty. It also warns that writes via update_elements are likely to be refused while generation is still in progress and that group would be overwritten when the render lands, none of which is available from the annotations.

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?

The description is long because the tool is complex, but it is front-loaded, uses bullets for kind-specific guidance, and keeps warnings and corrections close to the behaviors they affect. Even the 'phantom' correction earns its place by preventing a known polling mistake.

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 19-parameter async tool with no output schema and minimal annotations, the description covers the lifecycle, polling contract, caveats around writes and grouping, and the correct sibling tool for uploaded media. An agent has everything needed to invoke it safely and know what to expect.

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

Parameters5/5

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

Schema coverage is 100%, but the description still adds significant meaning beyond the schema: it partitions optional parameters by kind, explains that animation_setting must be set at creation time, clarifies that group is not accepted, and points to find for style_id. This materially improves the agent's ability to construct correct calls.

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?

The opening sentence uses a specific verb and resource: 'Generate an AI image or canvas-code-based animation directly into a clip.' It names the two kinds explicitly and the tip at the end differentiates it from add_elements, so an agent can tell exactly what this tool is for.

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?

The description gives an explicit decision rule: use this tool for 'generated', 'AI', or 'create me a' visuals, and use add_elements for uploaded photos/logos/icons/GIFs. It also tells the agent when not to follow up with update_elements and explains that group is deliberately unsupported here, replacing it with a concrete two-step alternative.

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.