Skip to main content
Glama

update_node_input

Modify specific inputs on nodes within ComfyUI workflows to adjust parameters and values during 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 @mcp.tool()-decorated function that defines and implements the 'update_node_input' tool. It updates a specific input on a node in the workflow dictionary, parsing the value as JSON if possible.
    @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
  • Calls register_workflow_tools(mcp) which in turn registers the update_node_input tool among others.
    register_workflow_tools(mcp)
  • The function that registers all workflow tools, including update_node_input via @mcp.tool() decorators.
    def 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