get_queue_status
Check current workflow execution status in ComfyUI to monitor running and pending jobs, enabling queue management and progress tracking.
Instructions
Get current queue: running and pending jobs.
Returns:
- queue_running: List of currently executing workflows
- queue_pending: List of queued workflows waiting to run
- running_count: Number of running jobs
- pending_count: Number of pending jobs
Use this to check if workflows are executing or queued.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The main handler function decorated with @mcp.tool(). Fetches queue status from ComfyUI /queue endpoint, validates with QueueStatus model, computes additional fields, and handles errors.def get_queue_status(ctx: Context) -> dict: """Get current queue: running and pending jobs. Returns: - queue_running: List of currently executing workflows - queue_pending: List of queued workflows waiting to run - running_count: Number of running jobs - pending_count: Number of pending jobs Use this to check if workflows are executing or queued. """ ctx.info("Fetching queue status...") try: data = comfy_get("/queue") status = QueueStatus(**data) result = status.model_dump() result["running_count"] = status.running_count result["pending_count"] = status.pending_count result["is_empty"] = status.is_empty return result except Exception as e: return ErrorResponse.unavailable(str(e)).model_dump()
- src/comfy_mcp_server/models.py:53-70 (schema)Pydantic BaseModel for validating ComfyUI /queue response. Defines queue_running and queue_pending fields, and provides computed properties for counts and emptiness check.class QueueStatus(BaseModel): """Queue status from /queue endpoint.""" queue_running: list[list[Any]] = Field(default_factory=list) queue_pending: list[list[Any]] = Field(default_factory=list) @property def running_count(self) -> int: return len(self.queue_running) @property def pending_count(self) -> int: return len(self.queue_pending) @property def is_empty(self) -> bool: return self.running_count == 0 and self.pending_count == 0
- src/comfy_mcp_server/tools/__init__.py:23-28 (registration)Registers all tools by calling register_system_tools(mcp), which defines and registers the get_queue_status tool using @mcp.tool() decorator.def register_all_tools(mcp): """Register all tools with the MCP server.""" register_system_tools(mcp) register_discovery_tools(mcp) register_workflow_tools(mcp) register_execution_tools(mcp)
- src/comfy_mcp_server/__init__.py:92-92 (registration)In the main server initialization, calls register_all_tools(mcp) which ultimately registers the get_queue_status tool.register_all_tools(mcp)