Skip to main content
Glama

read_file

Access file contents from revenue-engine-mcp and apps-script directories to support revenue tracking, lead management, and business operations through Google Sheets, Gmail, and Calendar integration.

Instructions

Read contents of a file. Only works in allowed directories: revenue-engine-mcp, apps-script folders

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesFull file path (e.g., C:\Users\Node1\revenue-engine-mcp\index.js)

Implementation Reference

  • Handler implementation for the 'read_file' tool. Validates path permissions, checks file existence, reads file content using fs.readFileSync, and returns structured result.
    case "read_file": { const { path } = args; if (!isPathAllowed(path)) { throw new Error(`Access denied: Path not in allowed directories`); } if (!fs.existsSync(path)) { throw new Error(`File not found: ${path}`); } const content = fs.readFileSync(path, 'utf8'); result = { success: true, path: path, content: content, size: content.length }; break; }
  • index.js:541-554 (registration)
    Registration of the 'read_file' tool in the ListTools response, including name, description, and input schema definition.
    { name: "read_file", description: "Read contents of a file. Only works in allowed directories: revenue-engine-mcp, apps-script folders", inputSchema: { type: "object", properties: { path: { type: "string", description: "Full file path (e.g., C:\\Users\\Node1\\revenue-engine-mcp\\index.js)" } }, required: ["path"] } },
  • Helper function used by read_file (and other file tools) to validate if the requested path is within allowed directories.
    function isPathAllowed(filePath) { const normalized = filePath.replace(/\//g, '\\'); return ALLOWED_PATHS.some(allowedPath => normalized.startsWith(allowedPath) ); }
  • Configuration of allowed directories for file operations, used by isPathAllowed helper.
    const ALLOWED_PATHS = [ 'C:\\Users\\Node1\\revenue-engine-mcp', 'C:\\Users\\Node1\\Documents\\revenue-engine\\mcp-server', 'C:\\Users\\Node1\\Documents\\revenue-engine\\apps-script', ];

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/PromptishOperations/mcpSpec'

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