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)
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by explicitly warning about the behavioral limitation ('doesn't update connections from other nodes'). This discloses a critical trait that affects workflow integrity. However, it doesn't mention other behavioral aspects like error conditions, permissions needed, or what happens to the modified workflow object.

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?

The description is appropriately sized with three sentences that each serve a purpose: stating the action, documenting parameters, and providing a critical warning. It's front-loaded with the core purpose. The only minor inefficiency is repeating parameter descriptions that already exist in the schema.

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

Completeness3/5

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

For a mutation tool with no annotations and no output schema, the description provides adequate but incomplete context. The warning about connection updates is valuable, but it doesn't explain what the tool returns, how errors are handled, or the full implications of modifying the workflow dict. Given the complexity and lack of structured safety information, more behavioral disclosure would be beneficial.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters completely. The description repeats the parameter descriptions verbatim from the schema ('Workflow dict to modify', 'ID of node to remove'), adding no additional semantic meaning beyond what's already in the structured fields. Baseline 3 is appropriate when schema does all the work.

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 the specific action ('Remove a node') and resource ('from a workflow'), distinguishing it from sibling tools like 'add_node' or 'update_node_input'. It provides a precise verb+resource combination that leaves no ambiguity about the tool's function.

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

Usage Guidelines3/5

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

The description implies usage context through the warning about not updating connections, suggesting this tool should be used when removing a node without maintaining workflow connectivity. However, it doesn't explicitly state when to use this versus alternatives like 'update_node_input' or 'clear_queue', nor does it mention prerequisites or integration with other workflow management tools.

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

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