Skip to main content
Glama

get_task_result

Retrieve the status and output of animated video generation tasks from the Ghibli Video MCP Server using task IDs and API authentication.

Instructions

Get task result

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskIdYesTask ID
api_keyYesAPI key for authentication

Implementation Reference

  • MCP CallToolRequest handler case for 'get_task_result': validates taskId and api_key, calls GhibliClient.getTaskResult, returns JSON stringified result or error.
    case "get_task_result": {
      const taskId = String(request.params.arguments?.taskId);
      const apiKey = String(request.params.arguments?.api_key);
    
      if (!taskId) {
        throw new Error("Task ID cannot be empty");
      }
      if (!apiKey) {
        throw new Error("API key cannot be empty");
      }
    
      try {
        const result = await ghibliClient.getTaskResult(taskId, apiKey);
        return {
          content: [{
            type: "text",
            text: `Task result: ${JSON.stringify(result)}`
          }]
        };
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : 'Unknown error';
        throw new Error(`Get task result failed: ${errorMessage}`);
      }
    }
  • src/index.ts:94-111 (registration)
    Tool registration in ListToolsResponse: defines name, description, and input schema requiring taskId and api_key.
    {
      name: "get_task_result",
      description: "Get task result",
      inputSchema: {
        type: "object",
        properties: {
          taskId: {
            type: "string",
            description: "Task ID"
          },
          api_key: {
            type: "string",
            description: "API key for authentication"
          }
        },
        required: ["taskId", "api_key"]
      }
    }
  • GhibliClient.getTaskResult implementation: GET request to /api/video/result?task_id={taskId} with API key, returns task result data.
    async getTaskResult(taskId: string, apiKey: string): Promise<TaskResult> {
        // 打印请求信息
        const url = `${this.baseUrl}/api/video/result?task_id=${taskId}`;
        process.stderr.write(`\n[Request] GET ${url}\n`);
        process.stderr.write(`[Headers] ${JSON.stringify(this.getHeaders(apiKey), null, 2)}\n`);
    
        const response = await fetch(url, {
          method: 'GET',
          headers: this.getHeaders(apiKey)
        });
    
        // 打印响应状态
        process.stderr.write(`[Response] Status: ${response.status} ${response.statusText}\n`);
    
        if (!response.ok) {
          const error = `API request failed: ${response.statusText}`;
          process.stderr.write(`[Error] ${error}\n`);
          throw new Error(error);
        }
    
        const result = await response.json();
        process.stderr.write(`[Response Data] ${JSON.stringify(result, null, 2)}\n`);
        return result.data;
      }
  • TypeScript type definition for TaskResult, used as return type for getTaskResult.
    export type TaskResult = {
      status: 'pending' | 'completed' | 'failed';
      result?: string;
      error?: string;
    };
Behavior1/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Get task result' implies a read operation, but it does not specify whether this is safe, requires authentication (though the schema includes an api_key), involves side effects, or details response behavior. The description lacks any behavioral traits beyond the basic action, making it inadequate for a tool with no annotation support.

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?

The description is extremely concise with just three words, 'Get task result', which is front-loaded and wastes no space. Every word directly contributes to stating the tool's purpose, making it efficient and well-structured for its minimal content.

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?

Given the tool's complexity (a read operation with authentication) and lack of annotations and output schema, the description is incomplete. It does not explain what a 'task result' is, how results are returned, or any behavioral context. The schema covers parameters, but the overall tool behavior remains underspecified, leaving significant gaps for agent understanding.

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?

The input schema has 100% description coverage, with clear documentation for 'taskId' and 'api_key'. The description adds no additional meaning beyond what the schema provides, as it does not explain parameter usage or constraints. According to the rules, with high schema coverage (>80%), the baseline score is 3 when no param info is added in the description.

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

Purpose2/5

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

The description 'Get task result' is a tautology that essentially restates the tool name 'get_task_result'. It specifies the verb 'get' and resource 'task result', but provides no additional context about what a 'task result' entails or how this differs from sibling tools like 'get_points' or 'image_to_video'. The purpose is minimally stated but lacks specificity and differentiation.

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

Usage Guidelines1/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. There are no indications of context, prerequisites, or exclusions, and it does not reference sibling tools or suggest when this tool is appropriate. This leaves the agent with no usage instructions beyond the tool name.

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/MichaelYangjson/mcp-ghibli-video'

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