Skip to main content
Glama

luma_extend_video

Extend existing videos by adding continuation frames and new motion. Provide a video ID and prompt to generate additional footage, building longer video content piece by piece.

Instructions

Extend an existing video with additional content.

This allows you to continue a previously generated video, adding more motion
and content after the original video ends.

Use this when:
- A generated video is too short and you want to add more
- You want to continue the story or motion from a previous video
- You're building a longer video piece by piece

Returns:
    Task ID and the extended video information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
video_idYesID of the video to extend. This is the 'video_id' field from a previous generation result.
promptYesDescription of what should happen in the extended portion of the video. Describe the continuation of motion and new content.
end_image_urlNoOptional URL of an image to use as the final frame of the extended video.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Main handler function for luma_extend_video tool. Extends an existing video by its ID with additional content using the Luma API. Takes video_id, prompt, and optional end_image_url as parameters.
    @mcp.tool()
    async def luma_extend_video(
        video_id: Annotated[
            str,
            Field(
                description="ID of the video to extend. This is the 'video_id' field from a previous generation result."
            ),
        ],
        prompt: Annotated[
            str,
            Field(
                description="Description of what should happen in the extended portion of the video. Describe the continuation of motion and new content."
            ),
        ],
        end_image_url: Annotated[
            str,
            Field(
                description="Optional URL of an image to use as the final frame of the extended video."
            ),
        ] = "",
    ) -> str:
        """Extend an existing video with additional content.
    
        This allows you to continue a previously generated video, adding more motion
        and content after the original video ends.
    
        Use this when:
        - A generated video is too short and you want to add more
        - You want to continue the story or motion from a previous video
        - You're building a longer video piece by piece
    
        Returns:
            Task ID and the extended video information.
        """
        payload = {
            "action": "extend",
            "video_id": video_id,
            "prompt": prompt,
        }
    
        if end_image_url:
            payload["end_image_url"] = end_image_url
    
        result = await client.generate_video(**payload)
        return format_video_result(result)
  • Input schema for luma_extend_video defined via Pydantic Annotated Field types. Defines video_id (required str), prompt (required str), and end_image_url (optional str with default='').
    @mcp.tool()
    async def luma_extend_video(
        video_id: Annotated[
            str,
            Field(
                description="ID of the video to extend. This is the 'video_id' field from a previous generation result."
            ),
        ],
        prompt: Annotated[
            str,
            Field(
                description="Description of what should happen in the extended portion of the video. Describe the continuation of motion and new content."
            ),
        ],
        end_image_url: Annotated[
            str,
            Field(
                description="Optional URL of an image to use as the final frame of the extended video."
            ),
        ] = "",
    ) -> str:
  • core/server.py:42-49 (registration)
    MCP server initialization where the FastMCP instance is created. The @mcp.tool() decorator used in video_tools.py registers tools with this mcp instance.
    # Initialize FastMCP server
    mcp = FastMCP(
        settings.server_name,
        icons=[Icon(src="https://cdn.acedata.cloud/ahjfwi.png")],
        **mcp_kwargs,
    )
    
    logger.info(f"Initialized MCP server: {settings.server_name}")
  • tools/__init__.py:1-11 (registration)
    Tools module initialization that imports video_tools (and others), causing the @mcp.tool() decorators to execute and register all tools with the MCP server.
    """Tools module for MCP Luma server."""
    
    # Import all tools to register them with the MCP server
    from tools import info_tools, task_tools, video_tools
    
    __all__ = [
        "video_tools",
        "task_tools",
        "info_tools",
    ]
  • main.py:112-116 (registration)
    Main entry point where the tools module is imported, triggering the registration of luma_extend_video and other tools via their @mcp.tool() decorators.
    # Import tools and prompts to register them
    safe_print("  Loading tools and prompts...")
    import prompts  # noqa: F401, I001
    import tools  # noqa: F401
Behavior3/5

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

No annotations provided, so description carries full burden. Mentions return of 'Task ID' implying async behavior, and clarifies content is added 'after the original video ends'. However, omits whether operation creates a new video asset or modifies existing, plus lacks safety/mutation details.

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?

Excellent structure with clear front-loading (purpose in first sentence), followed by elaboration, bulleted usage guidelines, and return value specification. No redundant or wasted text.

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 3-parameter schema with full coverage and existence of output schema, the description adequately covers purpose, usage context, and return values. Minor gap in clarifying whether the original video is preserved or replaced.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with detailed descriptions for video_id, prompt, and end_image_url. The main description doesn't add parameter syntax or format details beyond what's in the schema, meeting the baseline for high-coverage schemas.

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?

States the specific action (extend) and resource (video) clearly. Distinguishes from sibling 'luma_generate_video' by emphasizing 'existing' and 'previously generated' video, and implicitly from 'luma_extend_video_from_url' by requiring video_id from prior results.

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?

Provides explicit 'Use this when:' section with three concrete scenarios (too short videos, continuing stories, building longer pieces). Lacks explicit contrast with sibling 'luma_extend_video_from_url' for URL-based extension vs. ID-based.

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/AceDataCloud/MCPLuma'

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