Skip to main content
Glama

comfy_delete_workflow

Remove saved workflows from the ComfyUI library to manage your workflow collection. Requires confirmation for safety before deletion.

Instructions

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

Input Schema

NameRequiredDescriptionDefault
nameYes
confirmNo

Input Schema (JSON Schema)

{ "properties": { "confirm": { "default": false, "type": "boolean" }, "name": { "type": "string" } }, "required": [ "name" ], "type": "object" }

Implementation Reference

  • The main handler function that executes the comfy_delete_workflow tool. Validates the confirmation flag, calls the delete helper, handles errors, and formats the response.
    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 for input validation: requires workflow name and optional confirmation boolean (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)
    Tool registration in the listTools handler, providing name, description, and input schema.
    { name: 'comfy_delete_workflow', description: 'Delete a saved workflow from the MCP library. Requires confirmation for safety.', inputSchema: zodToJsonSchema(DeleteWorkflowSchema) as any, },
  • src/server.ts:173-174 (registration)
    Switch case in callTool handler that routes to the delete workflow handler function.
    case 'comfy_delete_workflow': return await handleDeleteWorkflow(args as any);
  • Supporting utility that constructs the workflow file path and deletes it using Node.js fs.unlinkSync.
    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); }

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