Skip to main content
Glama
anyrxo

Proton Drive MCP

by anyrxo

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
NameRequiredDescriptionDefault
pathYesPath to delete relative to Proton Drive root

Implementation Reference

  • 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'],
      },
    },
  • 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'],
      },
    },

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/anyrxo/proton-drive-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server