Skip to main content
Glama
anyrxo
by anyrxo

create_folder

Create a new folder in Proton Drive by specifying the desired path, enabling organized file storage and management through the Proton Drive MCP server.

Instructions

Create a new folder in Proton Drive

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesFolder path relative to Proton Drive root

Implementation Reference

  • The handler function for the 'create_folder' tool. It validates the input path using validatePath, creates the folder recursively using fs.promises.mkdir, and returns a success message with the relative path or throws an McpError on failure.
    case 'create_folder': { const folderPath = validatePath(args?.path as string); try { await mkdir(folderPath, { recursive: true }); return { content: [ { type: 'text', text: `Successfully created folder: ${getRelativePath(folderPath)}`, }, ], }; } catch (error: any) { throw new McpError( ErrorCode.InternalError, `Cannot create folder: ${error.message}` ); } }
  • src/index.ts:191-204 (registration)
    Registration of the 'create_folder' tool in the ListTools response, including name, description, and input schema specifying a required 'path' string parameter.
    { name: 'create_folder', description: 'Create a new folder in Proton Drive', inputSchema: { type: 'object', properties: { path: { type: 'string', description: 'Folder path relative to Proton Drive root' }, }, required: ['path'], }, },
  • Helper function used by create_folder (and other tools) to validate and resolve relative paths to absolute paths within the Proton Drive root directory, preventing path traversal attacks.
    function validatePath(relativePath: string): string { // Handle empty path if (!relativePath) { return PROTON_DRIVE_PATH; } // Clean the path - remove leading slashes and normalize const cleaned = relativePath .split(/[/\\]+/) .filter(Boolean) .join(sep); const fullPath = resolve(PROTON_DRIVE_PATH, cleaned); // Security check - ensure we're still within Proton Drive if (!fullPath.startsWith(PROTON_DRIVE_PATH)) { throw new Error('Invalid path: Access denied outside Proton Drive'); } return fullPath; }

Other Tools

Related Tools

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