Skip to main content
Glama

generate_video

Start a video generation: text-to-video (prompt only), image-to-video (image_url; add end_image_url for a first+last-frame clip), reference-to-video (image_urls / reference_video_urls on multi-reference models), lip-sync / talking photo (image_url + audio_url on lip-sync models), motion control (image_url + video_url on motion-control models — the driving video sets both the clip length and the cost: the server measures it and prices the call by its seconds, duration has no effect) or video edit / transform (video_url on video-edit models). Pick the model by capability in list_models; model-specific fields go in input (see get_model). The default model is tuned for quality and is not the cheapest one — compare reference prices in list_models. Returns request_id and cost in credits immediately — video renders take 1–10 minutes, poll with wait_generation.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "generate_video"
  }
}

Input Schema

NameRequiredDescriptionDefault
seedNoFixes randomness. Only for models that declare seed (see get_model); a model known not to apply it rejects the call. Video renders one clip per call (no batch) — for multiple distinct variants run separate calls with a different idempotency_key each (or a different seed each where the model declares seed); identical calls within ~20s are de-duplicated to one generation.
inputNoModel-specific parameters from get_model input_schema.parameters, keyed by parameter name and merged with the fields above — e.g. multi_shots, kling_elements, character_orientation. Some of them (e.g. sound, mode, speed, audio, multi_shots) change the cost of the call — get_model shows the reference pricing. A misspelled name, or a parameter this model is known not to apply, is rejected before the generation starts; the error lists the parameters the model declares.
modelNoModel slug from list_models (slugs may contain '/', e.g. 'grok-imagine/text-to-video' — pass verbatim). Omit to use the default video model (text-to-video or image-to-video is picked automatically based on image_url).
promptNoScene description. English recommended for best quality. Do not include on-screen text. Required for text-to-video; optional when the call carries media input (lip-sync and motion-control models work without it).
durationNoClip length in seconds — model-dependent (3–30; get_model lists the allowed values). Do not pass it to lip-sync and motion-control models: the server measures the audio / driving video and the clip follows its length, and a lip-sync model that does not declare duration rejects the call. With reference_video_urls it must be a whole number of seconds within the model range.
audio_urlNoPublic https URL of the speech audio (mp3/wav) for lip-sync / talking-photo models — the clip length follows the audio.
image_urlNoPublic https URL of the start frame — switches to image-to-video. Also the character/portrait photo for lip-sync and motion-control models.
video_urlNoPublic https URL of the source video: the driving motion clip for motion-control models (required there; 3–30 s, up to 10 s with character_orientation "image"; the result follows its length) or the clip to edit / transform for video-edit models.
image_urlsNoPublic https URLs of reference images (characters, products, style) for multi-reference / reference-to-video and video-edit models.
resolutionNoe.g. '480p', '720p', '1080p', '4k'. Only for models that declare resolution (see get_model).
aspect_ratioNoe.g. '16:9', '9:16', '1:1', '4:3', '3:4', '21:9' (model-dependent).
wait_secondsNoOptional inline wait before returning.
end_image_urlNoPublic https URL of the LAST frame for first+last-frame clips; requires image_url. Works on every model that supports a last frame — the server maps this one field to the name the model reads.
generate_audioNoGenerate a soundtrack/ambient audio. Only for models that declare an audio switch (see get_model); a model known not to apply it rejects the call.
idempotency_keyNoOptional stable key (up to 255 characters) to safely retry without creating a duplicate generation. Reuse the same key only when retrying the same request: the same key with a different model or input is rejected with idempotency_key_reuse.
negative_promptNoWhat to avoid. Only for models that declare negative_prompt (see get_model); a model known not to apply it rejects the call.
reference_video_urlsNoPublic https URLs of reference clips for reference-to-video models. The number of clips is model-dependent (get_model lists it as maxItems of reference_video_urls; e.g. 3 on Seedance 2, 10 on Seedance 2.5) — a call above the limit is rejected before any credits are reserved, clips are never dropped silently. The server measures each clip and adds its seconds to the cost — whole seconds rounded up, except that a tail of up to 0.1 s above a whole second is not counted (10.04 s counts as 10, 10.11 s as 11); durations sent by the client are ignored.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / idempotency_key / description
      Previous value: -"Optional stable key to safely retry without creating a duplicate generation. Reuse the same key when retrying the same request."New value: +"Optional stable key (up to 255 characters) to safely retry without creating a duplicate generation. Reuse the same key only when retrying the same request: the same key with a different model or input is rejected with idempotency_key_reuse."
    • addedInput schema / properties / idempotency_key / maxLength
      Added value: +255
  2. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Goes well beyond the annotations: discloses that the call is asynchronous (request_id + cost in credits returned immediately, 1–10 minute renders), that pricing is derived from server-measured seconds for motion-control driving video and reference clips, that rejections occur before credits are reserved, and that identical calls within ~20s are de-duplicated. These cost and de-duplication traits are not derivable from readOnlyHint/destructiveHint/openWorldHint and are exactly what an agent needs before spending credits.

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

Conciseness4/5

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

Front-loaded correctly — the mode taxonomy comes first, model selection second, cost/latency/polling last. However, the whole definition is two very dense sentences stitched with em-dashes and parentheticals, which makes it slow to scan for a 17-parameter tool; a short bulleted mode list would have been clearer at the same length.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers mode selection, model discovery, cost drivers, latency, return shape (request_id + credits) and next step (wait_generation), which is substantial for a complex async generation tool with no output schema. Remaining gaps are minor: the role of wait_seconds for inline waiting and the boundary with compose_video are left implicit.

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 100%, so the baseline is 3, but the description adds value the schema cannot: it consolidates a mode→parameter mapping (image_url + end_image_url for first/last frame, video_url for edit vs motion control) and flags the trap that duration has no effect on motion-control pricing. It does not mention seed, idempotency_key, resolution or negative_prompt, but those are covered verbosely in the schema itself.

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 ('Start a video generation') and immediately enumerates the six distinct modes it covers (text-to-video, image-to-video, reference-to-video, lip-sync, motion control, video edit) with the exact input combination that selects each. This lets an agent distinguish it from generate_image, generate_audio and compose_video without opening any schema.

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

Usage Guidelines4/5

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

Explicitly routes the agent to siblings: 'Pick the model by capability in list_models', 'model-specific fields go in input (see get_model)', and 'poll with wait_generation'. It also states when NOT to send duration (lip-sync / motion-control models). It never contrasts against compose_video, and it does not reconcile the 'poll with wait_generation' advice with the wait_seconds inline-wait parameter.

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.