Skip to main content
Glama

load_workflow

Load a ComfyUI workflow file to inspect or modify its structure and node configuration for automation purposes.

Instructions

Load a workflow file for inspection or modification.

Args: workflow_name: Workflow filename (e.g., 'my-workflow.json') Returns the workflow dict that can be modified and executed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workflow_nameYesWorkflow filename

Implementation Reference

  • The core implementation of the 'load_workflow' tool. This function is decorated with @mcp.tool(), which registers it with the MCP server when the enclosing register_workflow_tools() is executed. It loads and returns the contents of a specified workflow JSON file.
    @mcp.tool() def load_workflow( workflow_name: str = Field(description="Workflow filename"), ctx: Context = None, ) -> dict: """Load a workflow file for inspection or modification. Args: workflow_name: Workflow filename (e.g., 'my-workflow.json') Returns the workflow dict that can be modified and executed. """ if not settings.workflows_dir: return ErrorResponse.not_configured("COMFY_WORKFLOWS_DIR").model_dump() wf_path = Path(settings.workflows_dir) / workflow_name if not wf_path.exists(): return ErrorResponse.not_found( f"Workflow '{workflow_name}'", suggestion="Use list_workflows() to see available workflows", ).model_dump() if ctx: ctx.info(f"Loading workflow: {workflow_name}") with open(wf_path) as f: return json.load(f)
  • Within register_all_tools(), this line calls register_workflow_tools(mcp), which defines and registers the load_workflow tool via its decorator.
    register_workflow_tools(mcp)
  • Top-level tool registration call in the server initialization, which triggers the chain leading to 'load_workflow' registration.
    register_all_tools(mcp)
  • Pydantic-based input schema definition for the tool, specifying the 'workflow_name' parameter with description.
    def load_workflow( workflow_name: str = Field(description="Workflow filename"), ctx: Context = None, ) -> dict:

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