Skip to main content
Glama

comfy_load_workflow

Load saved workflows from the ComfyUI library by name to retrieve workflow JSON and metadata for AI image generation tasks.

Instructions

Load a saved workflow from the MCP library by name. Returns the workflow JSON and metadata.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes

Implementation Reference

  • Main handler function that executes the comfy_load_workflow tool by loading the workflow data and returning it as JSON, with error handling.
    export async function handleLoadWorkflow(input: LoadWorkflowInput) {
      try {
        const data = loadWorkflowFromLibrary(input.name);
    
        return {
          content: [{
            type: "text",
            text: JSON.stringify({
              name: data.name,
              workflow: data.workflow,
              description: data.description,
              tags: data.tags,
              created_at: data.created_at,
              updated_at: data.updated_at
            }, null, 2)
          }]
        };
      } catch (error: any) {
        if (error.message.includes('not found')) {
          return {
            content: [{
              type: "text",
              text: JSON.stringify(ComfyUIErrorBuilder.fileNotFound(input.name), null, 2)
            }],
            isError: true
          };
        }
    
        return {
          content: [{
            type: "text",
            text: JSON.stringify(ComfyUIErrorBuilder.executionError(error.message), null, 2)
          }],
          isError: true
        };
      }
    }
  • Helper function that performs the actual file reading and parsing of the workflow JSON from the library directory.
    export function loadWorkflowFromLibrary(name: string): any {
      const config = getConfig();
      const libraryPath = getFullPath(config.paths.workflow_library);
      const filePath = join(libraryPath, `${name}.json`);
    
      if (!existsSync(filePath)) {
        throw new Error(`Workflow not found: ${name}`);
      }
    
      const data = readFileSync(filePath, 'utf-8');
      return JSON.parse(data);
    }
  • Zod schema defining the input for the tool: requires a 'name' string.
    export const LoadWorkflowSchema = z.object({
      name: z.string()
    });
  • src/server.ts:97-101 (registration)
    Registration of the tool in the listTools response, specifying name, description, and input schema.
    {
      name: 'comfy_load_workflow',
      description: 'Load a saved workflow from the MCP library by name. Returns the workflow JSON and metadata.',
      inputSchema: zodToJsonSchema(LoadWorkflowSchema) as any,
    },
  • src/server.ts:167-168 (registration)
    Dispatch case in the CallToolRequestHandler that routes to the handler function.
    case 'comfy_load_workflow':
      return await handleLoadWorkflow(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. It mentions that the tool 'Returns the workflow JSON and metadata,' which adds some behavioral context about the output. However, it lacks details on error handling, permissions, rate limits, or whether this is a read-only operation (implied but not stated). For a tool with zero annotation coverage, this is insufficient.

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 a single, efficient sentence that front-loads the core action and includes the return value. There is no wasted language, making it highly concise and well-structured for quick understanding.

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 the tool's moderate complexity (1 parameter, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose and output but lacks details on usage context, error cases, or behavioral nuances. Without annotations or an output schema, more completeness would be beneficial, but it meets the minimum viable threshold.

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?

The description specifies that the tool loads 'by name,' which clarifies the purpose of the single parameter 'name' in the input schema. Since schema description coverage is 0%, the description compensates by adding meaningful context about what the parameter represents, though it doesn't detail format constraints or examples.

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

Purpose4/5

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

The description clearly states the action ('Load') and resource ('saved workflow from the MCP library by name'), with a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'comfy_list_workflows' or 'comfy_get_workflow' (if such existed), which would be needed for a perfect score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'comfy_list_workflows' (which might list workflows) and 'comfy_save_workflow' (which saves workflows), there's no indication of prerequisites, timing, or distinctions between these operations.

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