Skip to main content
Glama

生成视频

generate_video
DestructiveIdempotent

Generate videos from text prompts with optional first-frame or reference images, returning a task ID for polling and an estimated cost.

Instructions

用 Grok Imagine、Seedance 或 Kling 生成视频,会产生上游模型调用费用,返回 estimated_cost_usd。image 表示首帧;reference_images 表示不固定首帧的参考图。Grok、已适配 Seedance 与 Kling Omni 支持多参考图,数量和组合限制先查 list_media_models;Seedance 首帧与普通参考图不能混用。视频素材编辑暂未开放,上游编辑端点实测返回 HTTP 404;不要调用 video。长片先 prepare_story_shot,逐镜复用人物和衔接设定。立即返回 task_id,每约 5 秒用 get_task 续查。只有用户明确要求创作时调用。

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": {
      "operation_id": "<operation_id>",
      "model": "<model>",
      "prompt": "<prompt>"
    },
    "name": "generate_video"
  }
}

Input Schema

NameRequiredDescriptionDefault
imageNo视频首帧或单张编辑参考图:HTTPS、JPEG/PNG/WebP data URL 或本地图片路径
modelYes先从 list_media_models 选择可用模型
videoNo待编辑的单段 HTTPS MP4 视频链接,最长 8.7 秒;不支持本地路径、视频 data URL、多段混剪或视频延长。输出沿用源时长和比例,最高 720p
promptYes用户希望生成的内容
durationNo生成视频秒数,默认 5;视频编辑不得传入
credentialNo密钥别名;多把密钥时必填,不能传密钥本身
image_fileNoChatGPT 聊天中附加的单张图片,作用同 image;其他客户端请用 create_upload_link
resolutionNo模型支持的清晰度;以 list_media_models 为准
aspect_ratioNo模型支持的比例;图片默认 1:1,视频默认 16:9
operation_idYes本次创作唯一标识,例如 UUID。重试同一请求须复用原值,防止重复提交;新的用户需求才用新值
reference_filesNoChatGPT 聊天中附加的多张参考图,按顺序追加在 reference_images 之后
reference_imagesNo有序参考图片列表;格式同 image,素材合计不超过 14 MB。Grok 图片最多 3 张,视频经典版 7/1.5 版 14 张;已适配 Seedance 2.0 最多 9/2.5 最多 14 张、Kling Omni 7 张、Midjourney 10 张、部分 GPT Image 14 张。准确型号与首帧组合限制以 list_media_models.inputs 为准

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0-rc.13

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, but the description adds the operational meaning behind them: upstream model call costs are incurred and estimated_cost_usd is returned, and operation_id must be reused on retries to avoid duplicate submission. It also discloses that the call is asynchronous (immediate task_id) and that the video-editing path is dead (HTTP 404), which is behavior no annotation or schema field conveys. It stops short of stating quota/rate behavior or what specifically is consumed, so it is strong but not exhaustive.

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?

Information is front-loaded: cost and return value first, then parameter semantics, then constraints, then the async poll loop, then the usage gate. It is dense and reads as several concerns packed into successive clauses, but each sentence carries a distinct, actionable fact and nothing is padding.

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, nested-object tool with no output schema, the description covers what an agent actually needs: cost side effect, the returned estimated_cost_usd and task_id, the polling cadence with get_task, the prerequisite lookup with list_media_models, and the multi-shot workflow via prepare_story_shot. The only gap is that it never explains image_file/reference_files versus the string variants, which the schema descriptions already handle.

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 a 3 would be the baseline, but the description adds genuine meaning on top: it disambiguates image (first frame) from reference_images (unfixed-frame references) and flags that Seedance cannot mix a first frame with ordinary reference images. Pointing at list_media_models as the source of truth for model-specific counts is useful routing that the schema does not express.

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 states a specific verb and resource (生成视频) and names the concrete backends (Grok Imagine, Seedance, Kling), which immediately separates it from generate_image and from task-management siblings. An agent can tell what this tool produces without opening the 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?

It gives explicit routing rules: check list_media_models first for per-model reference-image limits, use prepare_story_shot for long films before going shot by shot, poll with get_task every ~5 seconds, and do not pass video because upstream editing returns 404. It even adds the negative trigger 'only call when the user explicitly requests creation', which is a real exclusion.

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