delete_file
Permanently delete files from your computer's file system. This action removes files immediately and cannot be undone, providing direct file management through PC control capabilities.
Instructions
Permanently delete a file from the file system. This operation cannot be undone. The file is immediately removed from the storage device.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | The path to the file to delete |
Implementation Reference
- src/index.ts:382-393 (handler)The switch case handler for the 'delete_file' tool. It extracts the file path from arguments, deletes the file using fs.unlink (Node.js promise-based unlink), and returns a success message in the expected MCP content format.case "delete_file": { const filePath = args.path as string; await fs.unlink(filePath); return { content: [ { type: "text", text: `Successfully deleted file ${filePath}`, }, ], }; }
- src/index.ts:112-125 (schema)The schema definition for the 'delete_file' tool, including name, description, and inputSchema specifying a required 'path' string parameter for MCP tool validation.{ name: "delete_file", description: "Permanently delete a file from the file system. This operation cannot be undone. The file is immediately removed from the storage device.", inputSchema: { type: "object", properties: { path: { type: "string", description: "The path to the file to delete", }, }, required: ["path"], }, },
- src/index.ts:261-263 (registration)The registration handler for listing tools, which returns the TOOLS array containing the 'delete_file' tool definition.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: TOOLS }; });