get_task_status
Retrieve the current state and progress of a video enhancement task using its task ID.
Instructions
查询视频增强任务状态
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | 任务ID |
Implementation Reference
- src/server.ts:45-47 (schema)Input schema for get_task_status tool: accepts a single required 'task_id' string parameter.
const GetTaskStatusSchema = z.object({ task_id: z.string().describe('任务ID'), }); - src/server.ts:133-161 (registration)Registration of the 'get_task_status' tool on the MCP server with schema and handler callback.
// get_task_status tool this.server.tool( 'get_task_status', '查询视频增强任务状态', GetTaskStatusSchema.shape, async (args) => { try { const result = await this.getTaskStatus(args.task_id); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [ { type: 'text', text: JSON.stringify({ success: false, error: errorMessage }, null, 2), }, ], }; } } ); - src/server.ts:353-374 (handler)Core handler for get_task_status. Sends GET request to API endpoint /api/v3/contents/generations/tasks/{taskId} and returns structured response with status, progress, video_url, and timestamps.
private async getTaskStatus(taskId: string): Promise<any> { const response = await this.client.get(`/api/v3/contents/generations/tasks/${taskId}`); const data = response.data; if (data.code !== 0 && data.code !== 200) { return { success: false, error: data.message }; } const result = data.data; return { success: true, task_id: result.task_id, status: result.status, progress: result.progress || 0, video_url: result.video_url, debug_video_url_length: result.video_url?.length, debug_video_url_full: result.video_url, error_message: result.error_message, created_at: result.created_at, updated_at: result.updated_at, }; }