check_image_status
Monitor the progress of AI image generation tasks by providing the task ID from generate_image to track completion status.
Instructions
Check the status of an image generation task
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | The task ID returned from generate_image |
Implementation Reference
- src/index.ts:649-678 (handler)MCP tool handler for 'check_image_status'. Retrieves image task status from KlingClient, formats detailed status text including URLs and dimensions if successful, and returns as text content.case 'check_image_status': { const status = await klingClient.getImageTaskStatus(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?.images) { statusText += '\n\nGenerated Images:'; status.task_result.images.forEach((image: any, index: number) => { statusText += `\n\nImage ${index + 1}:`; statusText += `\n- URL: ${image.url}`; if (image.width && image.height) { statusText += `\n- Dimensions: ${image.width}x${image.height}`; } }); statusText += '\n\nNote: Images will be cleared after 30 days for security.'; } return { content: [ { type: 'text', text: statusText, }, ], }; }
- src/index.ts:372-384 (schema)Tool schema definition including name, description, and input schema requiring 'task_id'.name: 'check_image_status', description: 'Check the status of an image generation task', inputSchema: { type: 'object', properties: { task_id: { type: 'string', description: 'The task ID returned from generate_image', }, }, required: ['task_id'], }, },
- src/kling-client.ts:405-417 (helper)Helper method in KlingClient that makes the API GET request to check image generation task status and handles errors.async getImageTaskStatus(taskId: string): Promise<any> { const path = `/v1/image/generation/${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; } }