Skip to main content
Glama

generate_video

Generate videos from text prompts or animate images. Edit existing videos with custom duration and aspect ratio.

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. 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).
    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).

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

Input Schema

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

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

With no annotations, description carries full burden. Discloses synchronous polling, file size/format constraints for video editing, and parameter ignore behavior. However, does not mention failure modes, rate limits, or idempotency.

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?

Well-structured with intro, modes, polling note, Args list, and Returns. Every sentence adds value. Information is front-loaded with main purpose.

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?

Given 9 parameters with no output schema or annotations, description covers all parameters, return format, and key behavioral constraints. Minor gap: no error handling details, but sufficient for typical use.

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 description coverage is 0%, so description entirely compensates. Defines each parameter with constraints (e.g., max 20 MB, .mp4, ≤8.7s for video_path) and clarifications (e.g., 'ignored when editing' for duration/aspect_ratio/resolution).

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?

Description clearly states 'Generate or edit videos with Grok Imagine' and enumerates text-to-video, image-to-video, and video editing modes. Distinguishes from siblings like 'extend_video' and 'generate_image'.

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 describes when to use each mode (text-to-video by default, provide image or source video for other modes) and mentions synchronous polling with 10-minute timeout. Lacks explicit when-not-to-use but provides clear context for alternatives.

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