superdesign_delete
Remove design files and update metadata to manage workspace organization in the Superdesign MCP Server.
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:36-39 (schema)Zod schema definition for superdesign_delete tool input validationconst 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 ListToolsRequestHandler, defining name, description, and inputSchema{ 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"], }, },
- dist/index.js:2224-2250 (handler)Main handler function for superdesign_delete tool. Parses args with schema, locates file in superdesign/design_iterations/, deletes it using unlinkSync, updates metadata.json by filtering out the deleted entry, 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}` }], }; } }