Skip to main content
Glama

comfy_clear_queue

Clear all pending items from the ComfyUI queue without affecting currently running generations. Requires confirmation to remove queued tasks.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
confirmNo

Implementation Reference

  • The primary handler function for the 'comfy_clear_queue' MCP tool. Validates confirmation, clears the ComfyUI queue via the client, and returns success/error responses.
    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 'comfy_clear_queue': a boolean confirmation flag.
    export const ClearQueueSchema = z.object({
      confirm: z.boolean().optional().default(false)
    });
  • src/server.ts:126-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 routing in the CallToolRequest handler that invokes the handleClearQueue function for 'comfy_clear_queue' calls.
    case 'comfy_clear_queue':
      return await handleClearQueue(args as any);
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses the confirmation requirement (a behavioral trait) and clarifies it doesn't affect running generations, but doesn't mention other important behaviors like whether this action is reversible, what happens to cleared items, or any permission requirements. The description adds some value but leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is perfectly front-loaded with the core action in the first clause, followed by important clarifications. Every sentence earns its place - the first states what it does, the second clarifies scope, and the third specifies a requirement. Zero waste, maximum efficiency.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive queue-clearing tool with no annotations and no output schema, the description is adequate but incomplete. It covers the basic action and confirmation requirement, but doesn't address important context like whether this requires special permissions, what the response looks like, or error conditions. Given the tool's destructive nature, more behavioral disclosure would be beneficial.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With only 1 parameter and 0% schema description coverage, the description compensates well by explaining the 'confirm' parameter's purpose ('Requires confirmation'). This adds crucial semantic meaning beyond the bare schema, though it doesn't specify the exact confirmation mechanism or format.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Clear all pending items from the queue') and distinguishes it from siblings by specifying it 'does not affect currently running generation'. This differentiates it from tools like comfy_cancel_generation which would affect active processes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context about when to use this tool (to clear pending queue items) and implicitly distinguishes it from cancellation tools. However, it doesn't explicitly mention alternatives like comfy_cancel_generation for stopping active processes or provide explicit 'when-not-to-use' guidance beyond the running generation clarification.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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