Skip to main content
Glama

excel_open_file

Access Excel files for financial analysis, investment calculations, expense tracking, and automated reporting using advanced formulas and projections.

Instructions

Open an existing Excel file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYes

Implementation Reference

  • The main handler function for the 'excel_open_file' tool. It calls ExcelManager.openWorkbook with the provided filePath and returns file information or an error.
    handler: async (args: any): Promise<ToolResult> => { try { const fileInfo = await excelManager.openWorkbook(args.filePath); return { success: true, data: fileInfo }; } catch (error) { return { success: false, error: error instanceof Error ? error.message : String(error) }; } }
  • Input schema defining the required 'filePath' parameter as a string.
    inputSchema: { type: "object", properties: { filePath: { type: "string" } }, required: ["filePath"] },
  • Core helper method in ExcelManager that loads the Excel file using ExcelJS, sets the current workbook, retrieves file stats, and returns metadata including worksheets list.
    async openWorkbook(filePath: string): Promise<ExcelFileInfo> { this.workbook = new ExcelJS.Workbook(); await this.workbook.xlsx.readFile(filePath); this.currentFile = filePath; const stats = await fs.stat(filePath); return { path: filePath, worksheets: this.workbook.worksheets.map(ws => ws.name), lastModified: stats.mtime, size: stats.size }; }
  • src/index.ts:32-44 (registration)
    Registration of all tools by spreading excelTools (which contains excel_open_file) into the central allTools array used for MCP tool listing and execution.
    const allTools = [ ...excelTools, ...financialTools, ...rentalTools, ...expenseTools, ...reportingTools, ...cashFlowTools, ...taxTools, ...analyticsTools, ...chartTools, ...complianceTools, ...propertyTools, ];
  • Tool object definition exported as part of excelTools array, which is imported and registered in src/index.ts.
    { name: "excel_open_file", description: "Open an existing Excel file", inputSchema: { type: "object", properties: { filePath: { type: "string" } }, required: ["filePath"] }, handler: async (args: any): Promise<ToolResult> => { try { const fileInfo = await excelManager.openWorkbook(args.filePath); return { success: true, data: fileInfo }; } catch (error) { return { success: false, error: error instanceof Error ? error.message : String(error) }; } } },

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/jeremycharlesgillespie/excel-mcp'

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