Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
task_idsYesList of task IDs to query. Allows querying multiple tasks at once.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • 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)
  • 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",
    },
  • 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,
    )
  • 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,
    )
Behavior3/5

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

No annotations provided, but description mentions 'efficient' and 'more efficient' implying non-destructive read. With output schema present, description does not need to detail return fields. However, it does not disclose behavioral traits like max batch size or partial failure handling.

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?

Concise and well-structured with clear sections for purpose, benefit, usage, and returns. Minor redundancy in bullet points but overall efficient.

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?

For a simple batch read tool with output schema, description covers purpose, when to use, and return info. Could mention error handling or limits but adequate.

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% with description of task_ids. Description adds context about efficiency and use cases but does not provide new semantic details beyond the schema.

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?

Description clearly states the tool queries multiple Seedream image tasks at once, with specific verb 'query' and resource 'multiple tasks'. It distinguishes from sibling seedream_get_task by highlighting batch efficiency.

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?

Explicitly lists three use cases with bullet points and compares to single-task alternative. However, lacks guidance on when not to use or error handling scenarios.

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

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