Skip to main content
Glama
vapagentmedia

VAP Media · Unified MCP Server for AI Agents (Flux · Veo · Suno)

get_task

Retrieve the status and result of an AI generation task. Get the image URL once processing is complete.

Instructions

Get the status and result of a generation task. Returns image URL when completed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_idYesTask UUID returned from generate_image

Implementation Reference

  • TaskResult data model used by the SDK client's get_task method to parse API responses.
    class TaskResult:
        """Result of task status query."""
        task_id: str
        status: str
        task_type: Optional[str] = None
        result_url: Optional[str] = None
        cost: float = 0.0
        created_at: Optional[str] = None
        completed_at: Optional[str] = None
        error: Optional[str] = None
        metadata: Optional[Dict[str, Any]] = None
    
        @classmethod
        def from_response(cls, data: dict) -> "TaskResult":
            """Create from API response."""
            return cls(
                task_id=data.get("task_id", ""),
                status=data.get("status", "unknown"),
                task_type=data.get("task_type") or data.get("type"),
                result_url=data.get("result_url") or data.get("image_url") or data.get("video_url") or data.get("audio_url"),
                cost=data.get("cost", 0.0),
                created_at=data.get("created_at"),
                completed_at=data.get("completed_at"),
                error=data.get("error"),
                metadata=data.get("metadata"),
            )
  • SDK client's synchronous get_task method that makes a GET request to /v3/tasks/{task_id} and returns a TaskResult.
            duration: Target duration in seconds (30-480, default 120)
            instrumental: Generate without vocals
            loudness_preset: Normalization (streaming, apple, broadcast)
            audio_format: Output format (mp3 or wav)
    
        Returns:
            MusicResult with task_id for async tracking. Cost: $0.68
        """
        payload = {
            "type": "music_generation",
            "params": {
                "description": prompt,
                "duration": duration,
                "instrumental": instrumental,
                "loudness_preset": loudness_preset,
                "audio_format": audio_format,
            }
        }
    
        data = self._request("POST", "/v3/tasks", json=payload)
        return MusicResult.from_response(data)
    
    # ============================================
    # Task Management
    # ============================================
    
    def get_task(self, task_id: str) -> TaskResult:
Behavior3/5

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

No annotations provided, so description must convey behavior. It explains that image URL is returned when completed, which is key. However, does not mention behavior for incomplete or failed tasks, or polling expectations.

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?

Two brief sentences that are front-loaded with the main action. No unnecessary words; every sentence adds value.

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?

For a simple tool with one parameter and no output schema, the description adequately covers what it does (get status/result) and what it returns (image URL when completed). No gaps given the simplicity.

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?

Input schema covers the single parameter (task_id) with 100% coverage. The description adds no additional meaning beyond what the schema already provides, aligning with baseline of 3.

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?

Clearly states it gets status and result of a generation task, and specifies return of image URL when completed. Distinguishes from sibling tools like generate_image (creation) and list_tasks (listing all tasks).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Implies use for checking completion of a generation task, but lacks explicit guidance on when to avoid or alternatives. Does not exclude other uses.

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/vapagentmedia/vap-showcase'

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