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
| Name | Required | Description | Default |
|---|---|---|---|
| task_ids | Yes | List of task IDs to query. Maximum recommended batch size is 50 tasks. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- tools/task_tools.py:53-77 (handler)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) - tools/task_tools.py:53-53 (registration)The @mcp.tool() decorator registers the function as an MCP tool with the FastMCP server instance imported from core.server.
@mcp.tool() - tools/task_tools.py:54-59 (schema)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: - core/utils.py:90-99 (helper)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", },