Skip to main content
Glama

comfy_list_workflows

Browse and filter saved ComfyUI workflows by name, description, or tags to find specific image generation templates quickly.

Instructions

List all saved workflows in the MCP library. Supports filtering by name, description, or tags.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filterNo
tagsNo

Implementation Reference

  • The handler function for the 'comfy_list_workflows' tool. It calls the helper listWorkflowsInLibrary with input parameters (filter and tags), formats the result with total_count, and returns it in MCP response format. Handles errors using ComfyUIErrorBuilder.
    export async function handleListWorkflows(input: ListWorkflowsInput) {
      try {
        const workflows = listWorkflowsInLibrary(input.filter, input.tags);
    
        return {
          content: [{
            type: "text",
            text: JSON.stringify({
              workflows,
              total_count: workflows.length
            }, null, 2)
          }]
        };
      } catch (error: any) {
        return {
          content: [{
            type: "text",
            text: JSON.stringify(ComfyUIErrorBuilder.executionError(error.message), null, 2)
          }],
          isError: true
        };
      }
    }
  • Core utility that lists workflows by scanning the library directory (.json files), parsing metadata, applying name/description filter and tags intersection filter, and returning array of metadata objects with file size.
    export function listWorkflowsInLibrary(filter?: string, tags?: string[]): any[] {
      ensureWorkflowLibraryExists();
    
      const config = getConfig();
      const libraryPath = getFullPath(config.paths.workflow_library);
      const files = readdirSync(libraryPath);
    
      const workflows = [];
    
      for (const file of files) {
        if (!file.endsWith('.json')) continue;
    
        const filePath = join(libraryPath, file);
        const stat = statSync(filePath);
        const data = JSON.parse(readFileSync(filePath, 'utf-8'));
    
        // Apply filters
        if (filter && !data.name?.includes(filter) && !data.description?.includes(filter)) {
          continue;
        }
    
        if (tags && tags.length > 0) {
          const workflowTags = data.tags || [];
          if (!tags.some((tag: string) => workflowTags.includes(tag))) {
            continue;
          }
        }
    
        workflows.push({
          name: data.name,
          description: data.description,
          tags: data.tags,
          created_at: data.created_at,
          updated_at: data.updated_at,
          size: stat.size
        });
      }
    
      return workflows;
    }
  • Zod schema for tool input validation: optional 'filter' string (searches name/description) and optional 'tags' array (must match at least one tag).
    export const ListWorkflowsSchema = z.object({
      filter: z.string().optional(),
      tags: z.array(z.string()).optional()
    });
  • src/server.ts:102-106 (registration)
    Tool metadata registration in the MCP ListTools handler response: name, description, and converted input JSON schema.
    {
      name: 'comfy_list_workflows',
      description: 'List all saved workflows in the MCP library. Supports filtering by name, description, or tags.',
      inputSchema: zodToJsonSchema(ListWorkflowsSchema) as any,
    },
  • src/server.ts:170-171 (registration)
    Switch case in MCP CallTool handler that routes calls to the specific handleListWorkflows implementation.
    case 'comfy_list_workflows':
      return await handleListWorkflows(args as any);
Behavior2/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 of behavioral disclosure. It mentions filtering but doesn't describe return format, pagination, error handling, or whether this is a read-only operation. For a list tool with zero annotation coverage, this leaves significant gaps in understanding how the tool behaves.

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 two sentences with zero waste: the first states the core purpose, and the second adds filtering details. It's front-loaded with the main action and appropriately sized for the tool's complexity.

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

Completeness3/5

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

Given no annotations and no output schema, the description is adequate for a simple list tool but incomplete. It covers purpose and parameters but lacks details on return values, error cases, or behavioral traits like whether it's safe or has side effects, which are important for an agent to use it correctly.

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?

With 0% schema description coverage, the description compensates by explaining what the parameters do: 'filter' is for name, description, or tags, and 'tags' is an array for tag-based filtering. This adds meaningful context beyond the bare schema, though it doesn't detail exact syntax or constraints.

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 'all saved workflows in the MCP library', making the purpose specific and unambiguous. It distinguishes this tool from siblings like comfy_load_workflow or comfy_save_workflow by focusing on listing rather than loading or saving workflows.

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

Usage Guidelines3/5

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

The description implies usage through the mention of filtering capabilities, suggesting it's for retrieving workflows with optional filters. However, it doesn't explicitly state when to use this tool versus alternatives like comfy_list_models or comfy_get_queue, nor does it provide exclusions or prerequisites for usage.

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/Nikolaibibo/claude-comfyui-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server