Skip to main content
Glama

get_operation

Check operation status and retrieve results in Media-infrastructure. Returns output URL when processing completes for media tasks like editing or format conversion.

Instructions

Get the status and result of an operation. Returns output URL when completed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
operation_idYesOperation UUID returned from an operation tool

Implementation Reference

  • Implementation of the get_task tool handler, which fetches task details from the VAP API. Note that the prompt mentions `get_task`, which is the correct tool name, and it is handled in `handle_tools_call` via `_handle_get_task`.
    def _handle_get_task(arguments: Dict) -> Dict:
        """
        Handle get_task tool call (Directive #241).
    
        Fetches task status from V3 API with proper video_url extraction.
        """
        task_id = arguments.get("task_id", "")
    
        if not task_id:
            return {
                "isError": True,
                "content": [{"type": "text", "text": "Error: task_id is required"}]
            }
    
        # Fetch task from V3 API
        response = make_v3_get_request(f"/v3/tasks/{task_id}")
    
        if "error" in response:
            return {
                "isError": True,
                "content": [{"type": "text", "text": f"Error: {response['error']}"}]
            }
    
        # Extract fields
        status = response.get("status", "unknown")
        task_type = response.get("type", "unknown")
        estimated_cost = response.get("estimated_cost", "N/A")
        actual_cost = response.get("actual_cost", "N/A")
        error_message = response.get("error_message")
        result = response.get("result", {}) or {}
    
        # Extract output URL (video, image, or audio)
        video_url = result.get("video_url") or result.get("output_url")
        image_url = result.get("image_url") or result.get("output_url")
    
        # D#508: Music tasks have audio_url in items array
        audio_url = None
        items = result.get("items", [])
        if items and isinstance(items, list) and len(items) > 0:
            audio_url = items[0].get("audio_url")
            # Also check for image_url in items (for image tasks)
            if not image_url:
                image_url = items[0].get("image_url")
    
        # Build response text
        lines = [
            f"Task: {task_id}",
            f"Type: {task_type}",
            f"Status: {status}",
            f"Estimated Cost: ${estimated_cost}",
        ]
    
        if actual_cost and actual_cost != "N/A":
            lines.append(f"Actual Cost: ${actual_cost}")
    
        if status == "completed":
            if audio_url:
                lines.append(f"\n🎵 Audio URL: {audio_url}")
            elif video_url:
                lines.append(f"\n🎬 Video URL: {video_url}")
            elif image_url:
                lines.append(f"\n🖼️ Image URL: {image_url}")
        elif status == "failed" and error_message:
            lines.append(f"\n❌ Error: {error_message}")
        elif status in ("pending", "queued", "executing"):
            lines.append(f"\n⏳ Task is still {status}. Check again shortly.")
    
        return {
            "content": [{
                "type": "text",
                "text": "\n".join(lines)
            }]
        }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the tool returns 'output URL when completed', which implies it's a polling/status-checking operation, but doesn't describe error handling, timeout behavior, rate limits, or what happens if the operation is still in progress.

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?

The description is appropriately concise with two sentences that directly state the tool's purpose and key behavioral detail. It's front-loaded with the main function and follows with the completion behavior, though it could be slightly more structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a status-checking tool with no annotations and no output schema, the description is incomplete. It doesn't explain what 'status' means (e.g., pending, running, completed, failed), what format the 'result' takes, or how to interpret the output URL. Given the complexity of operation monitoring, more context is needed.

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 description coverage is 100%, so the schema already fully documents the single parameter. The description adds minimal value by mentioning the operation_id comes 'from an operation tool', but doesn't provide additional context about format, validation, or example values beyond what the schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Get') and resource ('status and result of an operation'), and mentions the output URL when completed. However, it doesn't explicitly differentiate this tool from its sibling 'get_task', which appears to serve a similar monitoring function.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'get_task' or 'list_tasks'. It mentions the operation_id comes 'from an operation tool', but doesn't specify which sibling tools qualify as operation tools or when polling is appropriate.

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

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