check_video_status
Verify the progress and status of a video generation task initiated via MCP Kling using a specific task ID, ensuring real-time tracking of AI-powered video creation.
Instructions
Check the status of a video generation task
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | The task ID returned from generate_video or generate_image_to_video |
Implementation Reference
- src/index.ts:528-556 (handler)Handler for the 'check_video_status' tool: retrieves task status using KlingClient, formats detailed status text including video details if successful.case 'check_video_status': { const status = await klingClient.getTaskStatus(args.task_id as string); let statusText = `Task ID: ${status.task_id}\nStatus: ${status.task_status}`; if (status.task_status_msg) { statusText += `\nMessage: ${status.task_status_msg}`; } if (status.task_status === 'succeed' && status.task_result?.videos) { statusText += '\n\nGenerated Videos:'; status.task_result.videos.forEach((video, index) => { statusText += `\n\nVideo ${index + 1}:`; statusText += `\n- URL: ${video.url}`; statusText += `\n- Duration: ${video.duration}`; statusText += `\n- Aspect Ratio: ${video.aspect_ratio}`; }); statusText += '\n\nNote: Videos will be cleared after 30 days for security.'; } return { content: [ { type: 'text', text: statusText, }, ], }; }
- src/index.ts:210-223 (schema)Input schema for 'check_video_status' tool requiring a 'task_id' string parameter.{ name: 'check_video_status', description: 'Check the status of a video generation task', inputSchema: { type: 'object', properties: { task_id: { type: 'string', description: 'The task ID returned from generate_video or generate_image_to_video', }, }, required: ['task_id'], }, },
- src/kling-client.ts:235-247 (helper)Helper method in KlingClient that fetches video task status from Kling AI API endpoint.async getTaskStatus(taskId: string): Promise<TaskStatus> { const path = `/v1/videos/text2video/${taskId}`; try { const response = await this.axiosInstance.get(path); return response.data.data; } catch (error) { if (axios.isAxiosError(error)) { throw new Error(`Kling API error: ${error.response?.data?.message || error.message}`); } throw error; } }