Skip to main content
Glama

cancel_job

Interrupt and stop the currently running ComfyUI job, with escalation to free VRAM if the interrupt is not honored. Optionally clear all pending jobs.

Instructions

Stop the CURRENTLY RUNNING ComfyUI job ROBUSTLY. Sends an interrupt, then WAITS and verifies the job actually stopped — ComfyUI only honors interrupts BETWEEN steps, so a long single step (e.g. a high-res video sampler) can ignore a plain cancel. If the interrupt isn't honored it escalates to freeing VRAM (POST /free) and re-checks; if it STILL won't die it reports the job as WEDGED and tells you to restart_comfyui (an HTTP cancel cannot kill a stuck step). Set clear_pending:true to also drop ALL pending jobs in the same call — the correct 'reset the queue' action, since cancelling alone leaves pending jobs that would run next. The partial result is discarded. Use cancel_queued_job to remove one specific PENDING job instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
prompt_idNoOptional. If given, only interrupts the running job when its prompt_id matches; omit to interrupt whatever is currently running.
clear_pendingNoAlso clear ALL pending jobs (recommended when resetting after a stuck/slow render, so a re-queue doesn't stack behind a backlog). Default false.
Behavior5/5

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

Details the behavior comprehensively: sends interrupt, waits, verifies, escalates to VRAM free, reports wedged jobs. Discloses ComfyUI's interrupt limitation and partial result discard. Since no annotations are provided, description carries full burden and meets it.

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?

Relatively long but every sentence adds value. Front-loaded with core action, then details. Could be slightly more concise but well-structured and informative.

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

Completeness5/5

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

Covers behavior, parameter usage, alternatives, edge cases (long steps, wedged jobs), and proper use of clear_pending. No output schema needed; description is complete for this complex tool.

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?

Schema coverage is 100%, baseline 3. Description adds meaning: prompt_id is optional and can filter; clear_pending recommended when resetting. Provides context beyond schema descriptions.

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 it stops a currently running ComfyUI job robustly, with specific verb 'cancel_job' and resource 'currently running ComfyUI job'. It distinguishes from sibling tool 'cancel_queued_job' which removes a specific pending job.

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

Usage Guidelines5/5

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

Provides explicit guidance: use for a currently running job, with clear_pending option. Explicitly mentions alternative 'cancel_queued_job' for removing a specific pending job. Also advises when to use clear_pending (after stuck/slow render).

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

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