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; };

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