Skip to main content
Glama

runway_generateVideo

Generate videos from images and text prompts with customizable aspect ratios and durations. Create 5-10 second videos using your images as a starting point for dynamic visual content.

Instructions

Generate a video from an image and a text prompt. Accepted ratios are 1280:720, 720:1280, 1104:832, 832:1104, 960:960, 1584:672. Use 1280:720 by default. For duration, there are only either 5 or 10 seconds. Use 5 seconds by default. If the user asks to generate a video, always first use generateImage to generate an image first, then use the image to generate a video.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
durationYes
promptImageYes
promptTextNo
ratioYes

Implementation Reference

  • Handler function for the runway_generateVideo tool. It calls the Runway /image_to_video API endpoint with provided parameters and returns the task details as text content.
    async (params) => {
      const task = await callRunwayAsync("/image_to_video", {
        method: "POST",
        body: JSON.stringify({
          model: "gen4_turbo",
          promptImage: params.promptImage,
          promptText: params.promptText,
          ratio: params.ratio,
          duration: params.duration,
        }),
      });
      return { content: [{ type: "text", text: JSON.stringify(task) }] };
    }
  • Zod input schema defining parameters: promptImage (required string), promptText (optional string), ratio (string), duration (number).
    {
      promptImage: z.string(),
      promptText: z.string().optional(),
      ratio: z.string(),
      duration: z.number(),
    },
  • src/index.ts:75-97 (registration)
    Registration of the runway_generateVideo tool using server.tool(), including name, description, input schema, and inline handler function.
    server.tool(
      "runway_generateVideo",
      "Generate a video from an image and a text prompt. Accepted ratios are 1280:720, 720:1280, 1104:832, 832:1104, 960:960, 1584:672. Use 1280:720 by default. For duration, there are only either 5 or 10 seconds. Use 5 seconds by default. If the user asks to generate a video, always first use generateImage to generate an image first, then use the image to generate a video.",
      {
        promptImage: z.string(),
        promptText: z.string().optional(),
        ratio: z.string(),
        duration: z.number(),
      },
      async (params) => {
        const task = await callRunwayAsync("/image_to_video", {
          method: "POST",
          body: JSON.stringify({
            model: "gen4_turbo",
            promptImage: params.promptImage,
            promptText: params.promptText,
            ratio: params.ratio,
            duration: params.duration,
          }),
        });
        return { content: [{ type: "text", text: JSON.stringify(task) }] };
      }
    );
  • Helper function used by the handler to perform asynchronous API calls to Runway, polling for task completion if a task ID is returned.
    async function callRunwayAsync(
      path: string,
      opts: Partial<RequestInit> = {}
    ): Promise<RunwayTask> {
      const response = (await callRunway(path, opts)) as {
        id?: string;
      } & RunwayTask;
      // If the response has a taskId, wait for completion
      if (response?.id) {
        return waitForTaskCompletion(response.id);
      }
      // If no taskId, just return the response as is
      return response;
    }
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It adds valuable context beyond the schema: it specifies accepted ratios (e.g., 1280:720), default ratio (1280:720), allowed durations (5 or 10 seconds), and default duration (5 seconds). However, it does not mention other behavioral aspects like rate limits, authentication needs, or error handling, leaving some gaps.

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 appropriately sized and front-loaded: the first sentence states the core purpose, followed by specific constraints (ratios, durations) and usage guidelines. Every sentence adds essential information without redundancy, making it efficient and well-structured.

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 the complexity (video generation tool with 4 parameters), no annotations, and no output schema, the description is mostly complete. It covers purpose, constraints, defaults, and usage flow, but lacks details on output format, error cases, or authentication requirements, which could be important for an AI agent to use it correctly.

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?

The schema description coverage is 0%, so the description must compensate. It adds significant meaning beyond the schema: it explains that 'ratio' accepts specific values (e.g., 1280:720) and defaults to 1280:720, and 'duration' is either 5 or 10 seconds with a default of 5. This clarifies the semantics of two key parameters, though it does not detail 'promptImage' or 'promptText' beyond their names.

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 the tool's purpose: 'Generate a video from an image and a text prompt.' It specifies the verb ('generate'), resource ('video'), and inputs ('image' and 'text prompt'), distinguishing it from siblings like runway_generateImage (which generates images) and runway_editVideo (which edits existing videos).

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 provides explicit usage guidelines: 'If the user asks to generate a video, always first use generateImage to generate an image first, then use the image to generate a video.' This clearly states when to use this tool (after generating an image) and references an alternative (runway_generateImage) for the prerequisite step.

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/runwayml/runway-api-mcp-server'

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