Skip to main content
Glama

seedance_get_task

Check video generation task status and retrieve completed video URLs and metadata.

Instructions

Query the status and result of a video generation task.

Use this to check if a generation is complete and retrieve the resulting
video URLs, thumbnails, and other metadata.

Use this when:
- You want to check if a generation has completed
- You need to retrieve video URLs from a previous generation
- You want to get the full details of a generated video

Task statuses:
- 'running': Generation is still in progress
- 'succeeded': Generation finished successfully
- 'failed': Generation failed (check error message)

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_idYesThe task ID returned from a generation request. This is the 'task_id' field from any seedance_generate_* tool response.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Main handler function for the seedance_get_task tool. Queries a single task by ID via the Seedance API client, throttles polling with a 5-second sleep if the task is incomplete, and formats the result.
    @mcp.tool()
    async def seedance_get_task(
        task_id: Annotated[
            str,
            Field(
                description=(
                    "The task ID returned from a generation request. "
                    "This is the 'task_id' field from any seedance_generate_* "
                    "tool response."
                )
            ),
        ],
    ) -> str:
        """Query the status and result of a video generation task.
    
        Use this to check if a generation is complete and retrieve the resulting
        video URLs, thumbnails, and other metadata.
    
        Use this when:
        - You want to check if a generation has completed
        - You need to retrieve video URLs from a previous generation
        - You want to get the full details of a generated video
    
        Task statuses:
        - 'running': Generation is still in progress
        - 'succeeded': Generation finished successfully
        - 'failed': Generation failed (check error message)
    
        Returns:
            Task status and generated video information including URLs and metadata.
        """
        result = await client.query_task(
            id=task_id,
            action="retrieve",
        )
        # Throttle polling: sleep 5s for incomplete tasks so LLM clients
        # don't burn through poll attempts in seconds.
        response = result.get("response", {})
        is_complete = response.get("success", False)
        if not is_complete:
            await asyncio.sleep(5)
        return format_task_result(result)
  • Registration via the @mcp.tool() decorator which registers seedance_get_task as an MCP tool.
    @mcp.tool()
    async def seedance_get_task(
  • Input schema for seedance_get_task - a single required string parameter 'task_id' with Pydantic Field validation.
    task_id: Annotated[
        str,
        Field(
            description=(
                "The task ID returned from a generation request. "
                "This is the 'task_id' field from any seedance_generate_* "
                "tool response."
            )
        ),
    ],
  • Helper function that formats the task query result with polling guidance metadata injected by _with_task_guidance.
    def format_task_result(data: dict[str, Any]) -> str:
        """Format task query result as JSON.
    
        Args:
            data: API response dictionary
    
        Returns:
            JSON string representation of the result
        """
        return json.dumps(
            _with_task_guidance(data, "seedance_get_task", "seedance_get_tasks_batch"),
            ensure_ascii=False,
            indent=2,
        )
  • Utility that injects mcp_task_polling metadata (including poll_tool reference) into the task query response to guide the LLM on next steps.
    def _with_task_guidance(
        data: dict[str, Any], poll_tool: str, batch_poll_tool: str | None = None
    ) -> dict[str, Any]:
        payload = dict(data)
        task_id = payload.get("id") or payload.get("task_id")
        if not task_id:
            return payload
    
        payload["mcp_task_polling"] = {
            "task_id": task_id,
            "poll_tool": poll_tool,
            "batch_poll_tool": batch_poll_tool,
            "polling_interval_seconds": 15,
            "max_poll_attempts": 100,
            "next_step": (
                f"The task is still pending or processing. "
                f'Wait 15 seconds, then call {poll_tool}(task_id="{task_id}") again. '
                f"IMPORTANT: Media generation typically takes 1-5 minutes. "
                f"Keep polling — do NOT give up or tell the user it failed. "
                f"You should poll at least 100 times before considering the task stuck."
            ),
        }
        return payload
Behavior4/5

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

No annotations provided, but description adequately conveys it is a read-only query by describing statuses and result retrieval. Could explicitly state non-destructive, but it's clear from context.

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?

Description is well-structured with bullet points for usage and statuses. It is informative but slightly verbose; could be trimmed without loss.

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?

Output schema exists, so return values are fully specified. Description provides all needed context: purpose, usage, statuses, and what is returned, making it complete for a status check tool.

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%, and the parameter description in the input schema is already detailed. The tool description does not add extra semantics 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 it queries status and result of a video generation task. It distinguishes from sibling generation tools like seedance_generate_video by focusing on querying existing tasks.

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: checking completion, retrieving URLs, getting details. Also explains task statuses, giving practical guidance.

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

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