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
| Name | Required | Description | Default |
|---|---|---|---|
| delete_ids | No | Specific 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"
- src/comfy_mcp_server/tools/__init__.py:25-25 (registration)Registration call for system tools, including clear_queue, within the register_all_tools function.register_system_tools(mcp)
- src/comfy_mcp_server/__init__.py:92-92 (registration)Top-level call to register_all_tools(mcp), which indirectly registers the clear_queue tool.register_all_tools(mcp)