Skip to main content
Glama

hailuo_generate_video

Generate AI video from text prompts. Describe the scene, motion, and style to create high-quality videos without needing reference images.

Instructions

Generate AI video from a text prompt using Hailuo (MiniMax).

This is the simplest way to create video - just describe what you want and Hailuo
will generate a high-quality AI video.

Use this when:
- You want to create a video from a text description
- You don't have reference images
- You want quick text-to-video generation

For using a reference image, use hailuo_generate_video_from_image instead.

Returns:
    Task ID and generated video information including URLs and status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYesDescription of the video to generate. Be descriptive about the scene, motion, style, and mood. Examples: 'A cat walking through a garden with butterflies', 'Ocean waves crashing on a beach at sunset', 'A futuristic city with flying cars'
modelNoVideo generation model. Options: 'minimax-t2v' (text-to-video, default), 'minimax-i2v' (image-to-video, requires first_image_url), 'minimax-i2v-director' (director-mode image-to-video, requires first_image_url).minimax-t2v
callback_urlNoWebhook callback URL for asynchronous notifications. When provided, the API will call this URL when the video is generated.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'hailuo_generate_video' tool. Decorated with @mcp.tool(), it accepts a prompt (text description), an optional model (default 'minimax-t2v'), and an optional callback_url. It builds a payload dict with action='generate', prompt, and model, then calls client.generate_video() and formats the result.
    @mcp.tool()
    async def hailuo_generate_video(
        prompt: Annotated[
            str,
            Field(
                description="Description of the video to generate. Be descriptive about the scene, motion, style, and mood. Examples: 'A cat walking through a garden with butterflies', 'Ocean waves crashing on a beach at sunset', 'A futuristic city with flying cars'"
            ),
        ],
        model: Annotated[
            HailuoModel,
            Field(
                description="Video generation model. Options: 'minimax-t2v' (text-to-video, default), 'minimax-i2v' (image-to-video, requires first_image_url), 'minimax-i2v-director' (director-mode image-to-video, requires first_image_url)."
            ),
        ] = DEFAULT_MODEL,
        callback_url: Annotated[
            str | None,
            Field(
                description="Webhook callback URL for asynchronous notifications. When provided, the API will call this URL when the video is generated."
            ),
        ] = None,
    ) -> str:
        """Generate AI video from a text prompt using Hailuo (MiniMax).
    
        This is the simplest way to create video - just describe what you want and Hailuo
        will generate a high-quality AI video.
    
        Use this when:
        - You want to create a video from a text description
        - You don't have reference images
        - You want quick text-to-video generation
    
        For using a reference image, use hailuo_generate_video_from_image instead.
    
        Returns:
            Task ID and generated video information including URLs and status.
        """
        payload: dict = {
            "action": "generate",
            "prompt": prompt,
            "model": model,
        }
    
        if callback_url:
            payload["callback_url"] = callback_url
    
        result = await client.generate_video(**payload)
        return format_video_result(result)
  • Type definitions used by the tool: HailuoModel literal type (minimax-t2v, minimax-i2v, minimax-i2v-director) and DEFAULT_MODEL constant ('minimax-t2v'). These define the valid model parameter values.
    """Type definitions for Hailuo MCP server."""
    
    from typing import Literal
    
    # Hailuo video models
    HailuoModel = Literal[
        "minimax-t2v",
        "minimax-i2v",
        "minimax-i2v-director",
    ]
    
    # Default model
    DEFAULT_MODEL: HailuoModel = "minimax-t2v"
  • core/client.py:166-179 (registration)
    The client.generate_video() method called by the handler. It sends a POST request to the '/hailuo/videos' endpoint with the given payload, automatically adding an async callback URL if none is provided, and returns the API response.
        async def generate_video(self, **kwargs: Any) -> dict[str, Any]:
            """Generate video using the videos endpoint."""
            logger.info(f"Generating video with model: {kwargs.get('model', 'minimax-t2v')}")
            return await self.request("/hailuo/videos", self._with_async_callback(kwargs))
    
        async def query_task(self, **kwargs: Any) -> dict[str, Any]:
            """Query task status using the tasks endpoint."""
            task_id = kwargs.get("id") or kwargs.get("ids", [])
            logger.info(f"Querying task(s): {task_id}")
            return await self.request("/hailuo/tasks", kwargs)
    
    
    # Global client instance
    client = HailuoClient()
  • core/server.py:47-59 (registration)
    The MCP FastMCP server instance created in core/server.py. The @mcp.tool() decorator in video_tools.py registers 'hailuo_generate_video' as an MCP tool on this server.
    # Initialize FastMCP server
    mcp = FastMCP(
        settings.server_name,
        icons=[Icon(src="", mimeType="image/png")],
        **mcp_kwargs,
    )
    
    logger.info(f"Initialized MCP server: {settings.server_name}")
  • The format_video_result() helper function called by the handler. It formats the API response as JSON and adds submission guidance (poll_tool='hailuo_get_task', batch_poll_tool='hailuo_get_tasks_batch') for async polling.
    def format_video_result(data: dict[str, Any]) -> str:
        """Format video generation result as JSON.
    
        Args:
            data: API response dictionary
    
        Returns:
            JSON string representation of the result
        """
        return json.dumps(
            _with_submission_guidance(data, "hailuo_get_task", "hailuo_get_tasks_batch"),
            ensure_ascii=False,
            indent=2,
        )
Behavior3/5

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

No annotations are provided, so the description carries the burden. It mentions returning a Task ID and video information, implying an async workflow, but does not discuss side effects, error conditions, or rate limits. The behavioral disclosure is adequate but not beyond basics.

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 well-structured with a clear purpose, usage list, alternative note, and return description. It is concise without redundancy, though could be slightly shorter.

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 tool's simplicity, high schema coverage, and implied output schema, the description covers purpose, usage, alternatives, and return format. It lacks details on async behavior or prerequisites but is largely complete.

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 coverage is 100%, so the schema already provides parameter descriptions. The description adds context about when to use text prompts but does not add significant meaning beyond the schema. Baseline 3 is appropriate.

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 generates AI video from a text prompt using Hailuo. It distinguishes from sibling by specifying that this is for text-only input, while another tool handles image references.

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?

Provides explicit when-to-use scenarios (text description, no reference images, quick generation) and directs to an alternative (hailuo_generate_video_from_image) for image-based input.

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/HailuoMCP'

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