Skip to main content
Glama
anyrxo

Proton Drive MCP

by anyrxo

read_file

Retrieve and display text file contents stored in Proton Drive by specifying the file path to access documents directly from your secure cloud storage.

Instructions

Read a text file from Proton Drive

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesFile path relative to Proton Drive root

Implementation Reference

  • The main handler logic for the 'read_file' tool. It validates the input path, checks if the target is a file (not directory), reads the file content using Node.js fs/promises.readFile, and returns it as MCP text content block. Errors are handled with McpError.
    case 'read_file': {
      const readPath = validatePath(args?.path as string);
      
      try {
        // Check if it's a file
        const stats = await stat(readPath);
        if (stats.isDirectory()) {
          throw new Error('Cannot read a directory');
        }
        
        // Read the file
        const content = await readFile(readPath, 'utf-8');
        return {
          content: [
            {
              type: 'text',
              text: content,
            },
          ],
        };
      } catch (error: any) {
        throw new McpError(
          ErrorCode.InternalError,
          `Cannot read file: ${error.message}`
        );
      }
    }
  • Input schema definition for the 'read_file' tool, specifying an object with a required 'path' string property.
    inputSchema: {
      type: 'object',
      properties: {
        path: { 
          type: 'string', 
          description: 'File path relative to Proton Drive root' 
        },
      },
      required: ['path'],
    },
  • src/index.ts:145-158 (registration)
    Registration of the 'read_file' tool in the ListTools response, including name, description, and input schema.
    {
      name: 'read_file',
      description: 'Read a text file from Proton Drive',
      inputSchema: {
        type: 'object',
        properties: {
          path: { 
            type: 'string', 
            description: 'File path relative to Proton Drive root' 
          },
        },
        required: ['path'],
      },
    },
  • Helper function used by read_file (and other tools) to validate and resolve relative paths to absolute paths within the Proton Drive root, 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;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions reading 'a text file' but doesn't specify encoding, size limits, error handling for non-text files, or authentication requirements. For a file read operation with zero annotation coverage, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that communicates the core functionality without unnecessary words. It's appropriately sized for a simple read operation and front-loads the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a file read tool with no annotations and no output schema, the description is insufficient. It doesn't explain what format the content is returned in, whether there are encoding considerations, size limitations, or how it handles errors. Given the lack of structured fields, the description should provide more operational context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the single parameter 'path' already documented in the schema as 'File path relative to Proton Drive root'. The description adds no additional parameter context beyond what the schema provides, so the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Read') and resource ('a text file from Proton Drive'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'get_file_info' or 'list_files', but the verb 'Read' suggests content retrieval rather than metadata operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'get_file_info' (for metadata) or 'list_files' (for directory contents). The description only states what it does, not when it's appropriate or what distinguishes it from similar operations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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