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);

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