Skip to main content
Glama

check_image_status

Track the progress and status of an image generation task by providing the task ID returned from generate_image, ensuring efficient monitoring within MCP Kling's AI video generation system.

Instructions

Check the status of an image generation task

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_idYesThe task ID returned from generate_image

Implementation Reference

  • Handler for the 'check_image_status' tool. Calls klingClient.getImageTaskStatus(task_id), formats the status response including image URLs and dimensions if successful, and returns it 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:371-384 (registration)
    Tool registration in the TOOLS array, 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'], }, },
  • Input schema definition for the check_image_status tool.
    inputSchema: { type: 'object', properties: { task_id: { type: 'string', description: 'The task ID returned from generate_image', }, }, required: ['task_id'], },
  • Core helper method in KlingClient that makes the GET request to Kling AI's /v1/image/generation/{taskId} endpoint to fetch the task status.
    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; } }

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/199-mcp/mcp-kling'

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