Skip to main content
Glama

remove_node

Remove a node from a ComfyUI workflow to streamline automation processes. This tool modifies workflow structure by deleting specified nodes.

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
NameRequiredDescriptionDefault
workflowYesWorkflow dict to modify
node_idYesNode ID to remove

Implementation Reference

  • The handler function for the 'remove_node' MCP tool. It is decorated with @mcp.tool() for automatic registration and schema inference via Pydantic Fields. The function removes the specified node_id from the workflow dictionary if it exists and returns the modified workflow. Note that it does not update references/connections in other nodes.
    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
  • Invocation of register_workflow_tools(mcp) within register_all_tools, which registers the remove_node tool (along with other workflow tools) to the MCP server.
    register_workflow_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