delete_file
Remove files or folders from Proton Drive storage by specifying their path to manage storage space and organize content.
Instructions
Delete a file or folder from Proton Drive
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path to delete relative to Proton Drive root |
Implementation Reference
- src/index.ts:362-388 (handler)Handler for the 'delete_file' tool. Validates the input path using validatePath, determines if it's a file or directory using stat, deletes using rm (recursive for directories) or unlink (for files), and returns a success message or throws an MCP error on failure.case 'delete_file': { const deletePath = validatePath(args?.path as string); try { const stats = await stat(deletePath); if (stats.isDirectory()) { await rm(deletePath, { recursive: true, force: true }); } else { await unlink(deletePath); } return { content: [ { type: 'text', text: `Successfully deleted: ${getRelativePath(deletePath)}`, }, ], }; } catch (error: any) { throw new McpError( ErrorCode.InternalError, `Cannot delete: ${error.message}` ); } }
- src/index.ts:177-190 (registration)Registration of the 'delete_file' tool in the ListTools response, including its name, description, and input schema requiring a 'path' parameter.{ name: 'delete_file', description: 'Delete a file or folder from Proton Drive', inputSchema: { type: 'object', properties: { path: { type: 'string', description: 'Path to delete relative to Proton Drive root' }, }, required: ['path'], }, },
- src/index.ts:180-190 (schema)Input schema for the 'delete_file' tool, defining an object with a required 'path' string property.inputSchema: { type: 'object', properties: { path: { type: 'string', description: 'Path to delete relative to Proton Drive root' }, }, required: ['path'], }, },