seedream_get_tasks_batch
Check the status of multiple image generation tasks in a single request. Avoid querying each task individually to save time and resources.
Instructions
Query multiple Seedream image tasks at once.
Efficiently check the status of multiple tasks in a single request.
More efficient than calling seedream_get_task multiple times.
Use this when:
- You have multiple pending generations to check
- You want to get status of several images at once
- You're tracking a batch of generations
Returns:
Status and image information for all queried tasks.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_ids | Yes | List of task IDs to query. Allows querying multiple tasks at once. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- tools/task_tools.py:50-96 (handler)The main handler function for seedream_get_tasks_batch. Decorated with @mcp.tool(), it accepts a list of task_ids, calls client.query_task with action='retrieve_batch', formats the response, and returns a string summary.
@mcp.tool() async def seedream_get_tasks_batch( task_ids: Annotated[ list[str], Field(description="List of task IDs to query. Allows querying multiple tasks at once."), ], ) -> str: """Query multiple Seedream image tasks at once. Efficiently check the status of multiple tasks in a single request. More efficient than calling seedream_get_task multiple times. Use this when: - You have multiple pending generations to check - You want to get status of several images at once - You're tracking a batch of generations Returns: Status and image information for all queried tasks. """ result = await client.query_task( ids=task_ids, action="retrieve_batch", ) if "error" in result: error = result.get("error", {}) return f"Error: {error.get('code', 'unknown')} - {error.get('message', 'Unknown error')}" lines = [f"Total Tasks: {result.get('count', 0)}", ""] for item in result.get("items", []): response_info = item.get("response", {}) lines.extend( [ f"=== Task: {item.get('id', 'N/A')} ===", f"Created At: {item.get('created_at', 'N/A')}", f"Success: {response_info.get('success', False)}", ] ) for image in response_info.get("data", []): lines.append(f" 🖼️ Image: {image.get('image_url', 'N/A')}") lines.append("") return "\n".join(lines) - tools/task_tools.py:50-51 (registration)Tool registration via @mcp.tool() decorator on the handler function in tools/task_tools.py. The module is imported via tools/__init__.py which is imported in main.py.
@mcp.tool() async def seedream_get_tasks_batch( - main.py:170-173 (registration)Tool listed in the HTTP server card endpoint for registry/listing purposes.
{ "name": "seedream_get_tasks_batch", "description": "Query multiple tasks", }, - core/utils.py:67-71 (helper)format_image_result references seedream_get_tasks_batch as the batch_poll_tool parameter for submission guidance.
return json.dumps( _with_submission_guidance(data, "seedream_get_task", "seedream_get_tasks_batch"), ensure_ascii=False, indent=2, ) - core/utils.py:83-87 (helper)format_task_result references seedream_get_tasks_batch as the batch_poll_tool parameter for task polling guidance.
return json.dumps( _with_task_guidance(data, "seedream_get_task", "seedream_get_tasks_batch"), ensure_ascii=False, indent=2, )