Skip to main content
Glama

update_node_input

Modify specific inputs on workflow nodes to adjust parameters and values during ComfyUI automation processes.

Instructions

Update a specific input on a node.

    Args:
        workflow: Workflow dict to modify
        node_id: Node ID to update
        input_name: Name of the input to update
        value: New value (use JSON string for lists/dicts)

    Returns the modified workflow dict.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workflowYesWorkflow dict to modify
node_idYesNode ID to update
input_nameYesInput name to update
valueYesNew value (or JSON for complex values)

Implementation Reference

  • The core handler function for the 'update_node_input' tool. It updates a specific input on a given node in the workflow dictionary, parsing the value as JSON if possible. The @mcp.tool() decorator registers the tool with the MCP server.
    @mcp.tool()
    def update_node_input(
        workflow: dict = Field(description="Workflow dict to modify"),
        node_id: str = Field(description="Node ID to update"),
        input_name: str = Field(description="Input name to update"),
        value: str = Field(description="New value (or JSON for complex values)"),
        ctx: Context = None,
    ) -> dict:
        """Update a specific input on a node.
    
        Args:
            workflow: Workflow dict to modify
            node_id: Node ID to update
            input_name: Name of the input to update
            value: New value (use JSON string for lists/dicts)
    
        Returns the modified workflow dict.
        """
        if ctx:
            ctx.info(f"Updating {node_id}.{input_name}")
    
        if node_id not in workflow:
            return workflow
    
        # Try to parse as JSON for complex values
        try:
            parsed_value = json.loads(value)
        except json.JSONDecodeError:
            parsed_value = value
    
        workflow[node_id]["inputs"][input_name] = parsed_value
        return workflow
  • Registers all workflow tools, including 'update_node_input', by calling the register_workflow_tools function from workflow.py.
    register_workflow_tools(mcp)
  • Top-level registration of all tools, which includes the workflow tools containing 'update_node_input'.
    register_all_tools(mcp)
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool modifies a workflow dict and returns it, implying mutation, but doesn't cover critical aspects like whether changes are reversible, permission requirements, error handling, or side effects. This leaves significant gaps for a mutation tool.

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 front-loaded with the core purpose, followed by a structured Args section that efficiently lists parameters. It avoids unnecessary fluff, though the parameter details could be more integrated into the main text rather than a separate block.

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

Completeness2/5

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

Given no annotations, no output schema, and a mutation tool with nested objects, the description is incomplete. It lacks details on return format beyond 'modified workflow dict', error conditions, or how the update affects the workflow state, making it inadequate for safe and effective use.

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 all parameters thoroughly. The description adds minimal value by repeating parameter names and noting JSON string usage for complex values, which is already hinted in the schema. Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Update') and target ('a specific input on a node'), which is specific and actionable. However, it doesn't explicitly differentiate from sibling tools like 'add_node' or 'remove_node' in terms of scope, though the specificity of updating an input rather than the node itself provides some implicit distinction.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'add_node' or 'remove_node', nor does it mention prerequisites such as needing an existing workflow or node. It lacks explicit context for usage decisions.

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