list_workflows
Discover available workflow files in ComfyUI to select and execute saved automation processes for image generation and system management.
Instructions
List available workflow files.
Returns list of workflow JSON files in the configured workflows directory.
Use run_workflow() to execute a saved workflow.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The core handler function for the 'list_workflows' tool. It lists all *.json workflow files in the configured COMFY_WORKFLOWS_DIR directory, handling missing directory errors gracefully.@mcp.tool() def list_workflows(ctx: Context = None) -> list: """List available workflow files. Returns list of workflow JSON files in the configured workflows directory. Use run_workflow() to execute a saved workflow. """ if not settings.workflows_dir: return ["Error: COMFY_WORKFLOWS_DIR not configured"] if ctx: ctx.info(f"Listing workflows in: {settings.workflows_dir}") path = Path(settings.workflows_dir) if not path.exists(): return [] return sorted([f.name for f in path.glob("*.json")])
- src/comfy_mcp_server/tools/workflow.py:220-237 (registration)The @mcp.tool() decorator registers the list_workflows function as an MCP tool within the register_workflow_tools function.@mcp.tool() def list_workflows(ctx: Context = None) -> list: """List available workflow files. Returns list of workflow JSON files in the configured workflows directory. Use run_workflow() to execute a saved workflow. """ if not settings.workflows_dir: return ["Error: COMFY_WORKFLOWS_DIR not configured"] if ctx: ctx.info(f"Listing workflows in: {settings.workflows_dir}") path = Path(settings.workflows_dir) if not path.exists(): return [] return sorted([f.name for f in path.glob("*.json")])
- src/comfy_mcp_server/tools/__init__.py:27-27 (registration)Call to register_workflow_tools(mcp) within register_all_tools, which includes the list_workflows tool registration.register_workflow_tools(mcp)