superdesign_delete
Delete design files and update metadata using the MCP server. Specify the filename and workspace path to remove files efficiently from Superdesign workflows.
Instructions
Delete a design file and update metadata
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | Name of the design file to delete | |
| workspace_path | No | Workspace path (defaults to current directory) |
Implementation Reference
- dist/index.js:2224-2250 (handler)Handler function that parses arguments using DeleteDesignSchema, locates the design file in the superdesign/design_iterations directory, deletes it using unlinkSync, removes it from metadata.json by filtering the array and saving the updated metadata, and returns success or error message.case "superdesign_delete": { const { filename, workspace_path } = DeleteDesignSchema.parse(args); try { const superdesignDir = getSuperdeignDirectory(workspace_path); const designIterationsDir = path.join(superdesignDir, 'design_iterations'); const filePath = path.join(designIterationsDir, filename); if (!existsSync(filePath)) { return { content: [{ type: "text", text: `Error: Design file ${filename} does not exist` }], }; } // Delete the file unlinkSync(filePath); // Update metadata const metadata = loadMetadata(superdesignDir); const filteredMetadata = metadata.filter(m => m.fileName !== filename); saveMetadata(superdesignDir, filteredMetadata); return { content: [{ type: "text", text: `Successfully deleted ${filename}` }], }; } catch (error) { return { content: [{ type: "text", text: `Error deleting design: ${error.message}` }], }; } }
- dist/index.js:36-39 (schema)Zod schema defining the input parameters for the superdesign_delete tool: required filename (string) and optional workspace_path (string).const DeleteDesignSchema = z.object({ filename: z.string().describe("Name of the design file to delete"), workspace_path: z.string().optional().describe("Workspace path (defaults to current directory)") });
- dist/index.js:1897-1908 (registration)Tool registration in the listTools response, specifying the name, description, and inputSchema matching the DeleteDesignSchema.{ name: "superdesign_delete", description: "Delete a design file and update metadata", inputSchema: { type: "object", properties: { filename: { type: "string", description: "Name of the design file to delete" }, workspace_path: { type: "string", description: "Workspace path (defaults to current directory)" } }, required: ["filename"], }, },