Skip to main content
Glama

clear_queue

Remove pending jobs from the ComfyUI workflow queue by clearing all items or deleting specific prompt IDs to manage processing tasks.

Instructions

Clear the queue or delete specific items.

    Args:
        delete_ids: Optional list of prompt IDs to delete.
                   If not provided, clears entire queue.

    Use this to remove pending jobs from the queue.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
delete_idsNoSpecific prompt IDs to delete

Implementation Reference

  • The MCP tool handler for 'clear_queue'. It calls ComfyUI's /queue API to clear the queue or delete specific prompt IDs, logging via ctx and returning a success/failure message.
    @mcp.tool()
    def clear_queue(
        delete_ids: list = Field(default=None, description="Specific prompt IDs to delete"),
        ctx: Context = None,
    ) -> str:
        """Clear the queue or delete specific items.
    
        Args:
            delete_ids: Optional list of prompt IDs to delete.
                       If not provided, clears entire queue.
    
        Use this to remove pending jobs from the queue.
        """
        if ctx:
            if delete_ids:
                ctx.info(f"Deleting {len(delete_ids)} items from queue")
            else:
                ctx.info("Clearing entire queue")
    
        if delete_ids:
            status, _ = comfy_post("/queue", {"delete": delete_ids})
        else:
            status, _ = comfy_post("/queue", {"clear": True})
    
        return "Queue cleared" if status == 200 else "Clear failed"
  • Registration call for system tools, including clear_queue, within the register_all_tools function.
    register_system_tools(mcp)
  • Top-level call to register_all_tools(mcp), which indirectly registers the clear_queue tool.
    register_all_tools(mcp)
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool deletes or clears items, implying a destructive mutation, but doesn't cover critical aspects like permissions needed, whether deletions are permanent, error handling, or rate limits. For a destructive tool with zero annotation coverage, this is a significant gap in transparency.

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

Conciseness4/5

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

The description is concise and well-structured: it starts with a clear purpose statement, includes an Args section with parameter details, and ends with a usage tip. Each sentence adds value without redundancy. It could be slightly more front-loaded by integrating the usage tip earlier, but overall it's efficient and easy to parse.

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

Completeness2/5

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

Given the tool's complexity (destructive mutation with no output schema) and lack of annotations, the description is incomplete. It doesn't explain what happens after clearing (e.g., confirmation, error messages), potential side effects, or how it interacts with sibling tools like 'cancel_current'. For a queue management tool, more context on behavior and outcomes is needed.

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

Parameters3/5

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

The description adds minimal semantics beyond the input schema: it explains that 'delete_ids' is optional and that omitting it clears the entire queue. Since schema description coverage is 100%, the schema already documents the parameter well, so the description provides only marginal additional value, meeting the baseline for high coverage.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Clear the queue or delete specific items.' It specifies the verb ('clear'/'delete') and resource ('queue'/'items'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from siblings like 'cancel_current' or 'remove_node', which might have overlapping functions, preventing a perfect score.

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

Usage Guidelines3/5

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

The description provides some usage guidance: 'Use this to remove pending jobs from the queue.' This implies when to use it (for pending jobs) but doesn't specify when NOT to use it or mention alternatives like 'cancel_current' for active jobs. The guidance is helpful but incomplete, lacking explicit exclusions or comparisons to sibling tools.

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/IO-AtelierTech/comfyui-mcp'

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