Skip to main content
Glama

hailuo_get_tasks_batch

Check the status of multiple video generation tasks in a single request to efficiently track batch progress.

Instructions

Query multiple video generation tasks at once.

Efficiently check the status of multiple tasks in a single request.
More efficient than calling hailuo_get_task multiple times.

Use this when:
- You have multiple pending generations to check
- You want to get status of several videos at once
- You're tracking a batch of generations

Returns:
    Status and video information for all queried tasks.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_idsYesList of task IDs to query. Maximum recommended batch size is 50 tasks.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the hailuo_get_tasks_batch tool. It accepts a list of task_ids, queries the API via client.query_task with action='retrieve_batch', and returns formatted batch results.
    @mcp.tool()
    async def hailuo_get_tasks_batch(
        task_ids: Annotated[
            list[str],
            Field(description="List of task IDs to query. Maximum recommended batch size is 50 tasks."),
        ],
    ) -> str:
        """Query multiple video generation tasks at once.
    
        Efficiently check the status of multiple tasks in a single request.
        More efficient than calling hailuo_get_task multiple times.
    
        Use this when:
        - You have multiple pending generations to check
        - You want to get status of several videos at once
        - You're tracking a batch of generations
    
        Returns:
            Status and video information for all queried tasks.
        """
        result = await client.query_task(
            ids=task_ids,
            action="retrieve_batch",
        )
        return format_batch_task_result(result)
  • The @mcp.tool() decorator registers the function as an MCP tool with the FastMCP server instance imported from core.server.
    @mcp.tool()
  • Input schema for the tool: task_ids is a list of strings, with a maximum recommended batch size of 50 tasks, described via Pydantic's Annotated/Field pattern.
    async def hailuo_get_tasks_batch(
        task_ids: Annotated[
            list[str],
            Field(description="List of task IDs to query. Maximum recommended batch size is 50 tasks."),
        ],
    ) -> str:
  • The format_batch_task_result helper function is called by the handler to format the API response as a JSON string.
    def format_batch_task_result(data: dict[str, Any]) -> str:
        """Format batch task query result as JSON.
    
        Args:
            data: API response dictionary
    
        Returns:
            JSON string representation of the result
        """
        return json.dumps(data, ensure_ascii=False, indent=2)
  • main.py:172-175 (registration)
    Explicit mention of the tool name in the HTTP server card JSON response for tool listing.
    {
        "name": "hailuo_get_tasks_batch",
        "description": "Query multiple tasks",
    },
Behavior4/5

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

Without annotations, the description carries the burden. It uses 'Query' and 'check status' to imply a read-only operation, and mentions batch size limit. It does not explicitly state nondestructive nature, but the context strongly suggests it, making it sufficiently transparent.

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 concise with three sentences and a bullet list for usage scenarios. It is front-loaded with purpose and efficiently conveys all necessary guidance without extraneous information.

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?

Given the output schema exists, the description appropriately states return type. It covers usage scenarios and batch limit. The tool is simple with one parameter, and the description provides complete context for invocation.

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 input schema has one parameter with a description including the recommended batch size of 50 tasks. The description adds context on return value ('Status and video information'), fully covering the parameter semantics.

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 queries multiple video generation tasks at once, and explicitly distinguishes it from the sibling hailuo_get_task by noting it is more efficient than calling that tool multiple times.

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 when-to-use scenarios (multiple pending generations, status of several videos, tracking a batch) and implicitly distinguishes from hailuo_get_task, giving clear guidance on appropriate usage.

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