Skip to main content
Glama

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
NameRequiredDescriptionDefault

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")])
  • 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")])
  • Call to register_workflow_tools(mcp) within register_all_tools, which includes the list_workflows tool registration.
    register_workflow_tools(mcp)
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses that it returns a list of files, which is basic behavioral info. However, it lacks details like error handling, permissions needed, or whether it's read-only (though implied by 'List'), leaving gaps in behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose in the first sentence, followed by a clarifying detail and a usage guideline. Every sentence adds value, with no wasted words, making it highly efficient and well-structured.

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

Completeness4/5

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

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is complete enough for a list operation. It explains what it returns and when to use alternatives. A minor deduction because it could mention format specifics (e.g., JSON structure) or error cases, but overall it's sufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are 0 parameters, and schema description coverage is 100%, so the baseline is high. The description adds no parameter info (as none exist), but this is appropriate and doesn't detract from clarity. A 4 reflects that it handles the zero-parameter case well without unnecessary details.

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

Purpose5/5

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

The description clearly states the verb 'List' and the resource 'available workflow files', specifying they are 'JSON files in the configured workflows directory'. It distinguishes from siblings like 'run_workflow' by focusing on listing rather than executing.

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

Usage Guidelines5/5

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

It explicitly states 'Use run_workflow() to execute a saved workflow', providing a clear alternative for when not to use this tool. This directly addresses when to use this tool versus a sibling, which is ideal.

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