comfy_get_queue
Retrieve current generation queue details to monitor running and pending AI image processing tasks in ComfyUI.
Instructions
Get detailed information about the current generation queue, including running and pending items.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/queue.ts:5-47 (handler)The handler function that implements the core logic of the 'comfy_get_queue' tool. It retrieves the current queue from the ComfyUI client, formats the running and pending items, and returns a JSON response.export async function handleGetQueue() { try { const client = getComfyUIClient(); const queue = await client.getQueue(); return { content: [{ type: "text", text: JSON.stringify({ running: queue.queue_running.map((item: any) => ({ prompt_id: item[1], number: item[0], workflow_summary: "generation" })), pending: queue.queue_pending.map((item: any) => ({ prompt_id: item[1], number: item[0], workflow_summary: "generation" })), summary: `${queue.queue_running.length} running, ${queue.queue_pending.length} pending` }, null, 2) }] }; } catch (error: any) { if (error.error) { return { content: [{ type: "text", text: JSON.stringify(error, null, 2) }], isError: true }; } return { content: [{ type: "text", text: JSON.stringify(ComfyUIErrorBuilder.connectionError(error.message), null, 2) }], isError: true }; } }
- src/server.ts:112-119 (registration)Registers the 'comfy_get_queue' tool in the MCP server's listTools response, specifying name, description, and input schema (empty object since no parameters required).{ name: 'comfy_get_queue', description: 'Get detailed information about the current generation queue, including running and pending items.', inputSchema: { type: 'object', properties: {}, }, },
- src/server.ts:176-177 (registration)In the tool call dispatcher switch statement, routes calls to 'comfy_get_queue' to the handleGetQueue function.case 'comfy_get_queue': return await handleGetQueue();
- src/server.ts:115-118 (schema)Defines the input schema for the 'comfy_get_queue' tool as an empty object (no input parameters required).inputSchema: { type: 'object', properties: {}, },