Skip to main content
Glama

generate_video

Create or edit videos from text prompts, images, or source videos. Supports text-to-video, image animation, and video editing with reference images for style guidance.

Instructions

Generate or edit videos with Grok Imagine.

Text-to-video by default. Provide an image to animate (image-to-video), or
a source video to edit. Only one mode per call. Reference images can be
added to guide style and subjects. Generation polls synchronously (xAI's
default timeout is 10 minutes).

Args:
    prompt: Video description, or the edit instruction for video editing.
    model: Video model (default `grok-imagine-video`).
    image_path: Local image to use as the starting frame.
    image_url: Public image URL to use as the starting frame.
    video_path: Local video to edit (max 20 MB, .mp4, ≤ 8.7s).
    video_url: Public video URL to edit (.mp4, ≤ 8.7s).
    reference_image_paths: Local images used as style/subject references.
    reference_image_urls: Public image URLs used as style/subject references.
    duration: Video length in seconds (1–15, ignored when editing).
    aspect_ratio: Aspect ratio like `"16:9"` or `"9:16"` (ignored when editing).
    resolution: `"480p"` or `"720p"` (ignored when editing).
    show_usage: Append a token usage and cost footer to the result (default False).

Returns:
    Markdown block with the generated video URL and actual duration.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNogrok-imagine-video
promptYes
durationNo
image_urlNo
video_urlNo
image_pathNo
resolutionNo
show_usageNo
video_pathNo
aspect_ratioNo
reference_image_urlsNo
reference_image_pathsNo
Behavior3/5

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

No annotations provided, so description carries full burden. It discloses synchronous polling with 10-minute timeout, file size limits for video_path (20 MB, ≤8.7s), and duration limits (1–15s). Missing details on rate limits, authentication needs, behavior on timeout, or parameter incompatibility handling.

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?

The description is thorough but somewhat lengthy; the first paragraph introduces modes and polling, followed by a bulleted Args list. It is well-structured and front-loaded, but could be more concise by reducing redundancy (e.g., repetition of 'ignored when editing').

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?

For a complex tool with 12 parameters and no output schema, the description covers modes, parameter interactions, and return value (Markdown with URL and duration). It lacks error handling details and some edge cases, but overall completeness is good.

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 0%, but the description provides a detailed Args section explaining each parameter, including defaults, constraints (e.g., duration ignored when editing), and usage context. This adds substantial meaning beyond the schema.

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 description clearly states it generates or edits videos with Grok Imagine, explicitly listing three modes (text-to-video, image-to-video, video editing) and reference images for style. This distinguishes it from sibling tools like generate_image or extend_video.

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

Usage Guidelines3/5

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

The description explains when to use each mode and that only one mode per call is allowed, and mentions synchronous polling. However, it lacks explicit guidance on when not to use this tool versus alternatives like extend_video, and does not cover prerequisites or error scenarios.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/merterbak/Grok-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server