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)

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