remove_node
Delete a specific node from a ComfyUI workflow to modify or simplify the automation process.
Instructions
Remove a node from a workflow.
Args:
workflow: Workflow dict to modify
node_id: ID of node to remove
Warning: This doesn't update connections from other nodes.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workflow | Yes | Workflow dict to modify | |
| node_id | Yes | Node ID to remove |
Implementation Reference
- The remove_node tool handler: removes the specified node from the workflow dictionary by deleting the key. Includes inline schema via Pydantic Field and registration via @mcp.tool() decorator.@mcp.tool() def remove_node( workflow: dict = Field(description="Workflow dict to modify"), node_id: str = Field(description="Node ID to remove"), ctx: Context = None, ) -> dict: """Remove a node from a workflow. Args: workflow: Workflow dict to modify node_id: ID of node to remove Warning: This doesn't update connections from other nodes. """ if ctx: ctx.info(f"Removing node: {node_id}") if node_id in workflow: del workflow[node_id] return workflow
- src/comfy_mcp_server/tools/__init__.py:27-27 (registration)Invocation of register_workflow_tools(mcp) which registers the remove_node tool among others.register_workflow_tools(mcp)