Skip to main content
Glama

comfy_delete_workflow

Remove saved workflows from the ComfyUI MCP Server library with confirmation prompts for safety.

Instructions

Delete a saved workflow from the MCP library. Requires confirmation for safety.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
confirmNo

Implementation Reference

  • The handler function for the 'comfy_delete_workflow' tool. Validates the confirmation flag, calls the filesystem delete helper, and returns a formatted MCP response with success or error details.
    export async function handleDeleteWorkflow(input: DeleteWorkflowInput) {
      try {
        if (!input.confirm) {
          throw ComfyUIErrorBuilder.validationError(
            'Set confirm=true to delete the workflow'
          );
        }
    
        deleteWorkflowFromLibrary(input.name);
    
        return {
          content: [{
            type: "text",
            text: JSON.stringify({
              name: input.name,
              deleted: true,
              message: `Workflow "${input.name}" deleted successfully`
            }, 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
        };
      }
    }
  • Zod schema defining the input parameters for the comfy_delete_workflow tool: workflow name (required) and confirmation flag (optional, defaults to false).
    // Delete Workflow Tool
    export const DeleteWorkflowSchema = z.object({
      name: z.string(),
      confirm: z.boolean().optional().default(false)
    });
  • src/server.ts:107-111 (registration)
    Registration of the 'comfy_delete_workflow' tool in the MCP server, including name, description, and input schema reference.
    {
      name: 'comfy_delete_workflow',
      description: 'Delete a saved workflow from the MCP library. Requires confirmation for safety.',
      inputSchema: zodToJsonSchema(DeleteWorkflowSchema) as any,
    },
  • Supporting utility function that performs the actual file deletion of the workflow JSON from the configured library directory.
    export function deleteWorkflowFromLibrary(name: string): void {
      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}`);
      }
    
      unlinkSync(filePath);
    }
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively communicates that this is a destructive operation ('Delete') and adds safety context ('Requires confirmation for safety'), which helps the agent understand the tool's impact and interaction requirements beyond basic functionality.

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 extremely concise with two sentences that directly address purpose and a key behavioral trait. Every word earns its place, and the information is front-loaded without unnecessary elaboration, making it efficient and easy to parse.

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 complexity (destructive operation with 2 parameters) and lack of annotations and output schema, the description is moderately complete. It covers the core action and a safety mechanism, but falls short in fully explaining parameter semantics, potential errors, or return values, leaving gaps for the agent to infer.

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

Parameters2/5

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

The schema description coverage is 0%, meaning parameters are undocumented in the schema. The description mentions 'confirmation for safety' which loosely relates to the 'confirm' parameter, but provides no details about the 'name' parameter or the meaning, format, or constraints of either parameter. It adds minimal value beyond the bare schema.

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 specific action ('Delete') and resource ('a saved workflow from the MCP library'), distinguishing it from sibling tools like comfy_list_workflows and comfy_save_workflow. It precisely communicates what the tool does without ambiguity.

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 for deletion of saved workflows, but provides no explicit guidance on when to use this tool versus alternatives like comfy_clear_queue or comfy_cancel_generation. It mentions a confirmation requirement, which hints at safety considerations, but lacks context about prerequisites or specific scenarios for invocation.

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