Skip to main content
Glama

cancel_current

Stop ongoing ComfyUI image generations by interrupting specific prompts or all running jobs to manage workflow execution.

Instructions

Interrupt current generation.

Args: prompt_id: Optional specific prompt ID to cancel. If not provided, cancels all running jobs. Use this to stop a long-running generation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
prompt_idNoSpecific prompt ID to cancel

Implementation Reference

  • The handler function for the 'cancel_current' tool. It sends a POST request to ComfyUI's /interrupt endpoint to cancel the current generation or a specific prompt_id. Includes inline schema via Pydantic Field and docstring. Registered via @mcp.tool() decorator.
    @mcp.tool() def cancel_current( prompt_id: str = Field(default=None, description="Specific prompt ID to cancel"), ctx: Context = None, ) -> str: """Interrupt current generation. Args: prompt_id: Optional specific prompt ID to cancel. If not provided, cancels all running jobs. Use this to stop a long-running generation. """ if ctx: msg = f"Cancelling prompt {prompt_id}" if prompt_id else "Cancelling all" ctx.info(msg) data = {"prompt_id": prompt_id} if prompt_id else {} status, _ = comfy_post("/interrupt", data) return "Interrupted successfully" if status == 200 else "Interrupt failed"
  • Top-level registration function that calls register_system_tools (which registers cancel_current).
    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)
  • Call to register_all_tools(mcp), which ultimately registers the cancel_current tool.
    register_all_tools(mcp)

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