Skip to main content
Glama

comfy_clear_queue

Remove all pending items from the ComfyUI generation queue while preserving currently running tasks. Requires user confirmation to prevent accidental deletions.

Instructions

Clear all pending items from the queue (does not affect currently running generation). Requires confirmation.

Input Schema

NameRequiredDescriptionDefault
confirmNo

Input Schema (JSON Schema)

{ "properties": { "confirm": { "default": false, "type": "boolean" } }, "type": "object" }

Implementation Reference

  • The main handler function that executes the logic for clearing the ComfyUI generation queue after user confirmation. It interacts with the ComfyUI client to get the queue, clear it, and returns a success message with the count of cleared items.
    export async function handleClearQueue(input: ClearQueueInput) { try { if (!input.confirm) { throw ComfyUIErrorBuilder.validationError( 'Set confirm=true to clear the queue' ); } const client = getComfyUIClient(); const queue = await client.getQueue(); const count = queue.queue_pending.length; await client.clearQueue(); return { content: [{ type: "text", text: JSON.stringify({ cleared: true, count, message: `Cleared ${count} pending items from queue` }, 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.executionError(error.message), null, 2) }], isError: true }; } }
  • Zod schema defining the input for the comfy_clear_queue tool, requiring a confirmation boolean.
    export const ClearQueueSchema = z.object({ confirm: z.boolean().optional().default(false) });
  • src/server.ts:125-129 (registration)
    Tool registration in the MCP server's listTools response, providing name, description, and input schema.
    { name: 'comfy_clear_queue', description: 'Clear all pending items from the queue (does not affect currently running generation). Requires confirmation.', inputSchema: zodToJsonSchema(ClearQueueSchema) as any, },
  • src/server.ts:182-183 (registration)
    Dispatch case in the CallToolRequestHandler that routes calls to the handleClearQueue function.
    case 'comfy_clear_queue': return await handleClearQueue(args as any);

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/Nikolaibibo/claude-comfyui-mcp'

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