Skip to main content
Glama

excel_get_formulas

Extract all formulas from Excel worksheets to analyze financial calculations, verify formulas, and maintain spreadsheet integrity for accounting workflows.

Instructions

Extract all formulas from a worksheet

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
worksheetNameYes

Implementation Reference

  • Tool registration object defining name, description, input schema, and handler function that delegates to ExcelManager.getCellFormulas
    { name: "excel_get_formulas", description: "Extract all formulas from a worksheet", inputSchema: { type: "object", properties: { worksheetName: { type: "string" } }, required: ["worksheetName"] }, handler: async (args: any): Promise<ToolResult> => { try { const formulas = await excelManager.getCellFormulas(args.worksheetName); return { success: true, data: formulas }; } catch (error) { return { success: false, error: error instanceof Error ? error.message : String(error) }; } } },
  • The tool handler function that calls the ExcelManager to get formulas from the specified worksheet
    handler: async (args: any): Promise<ToolResult> => { try { const formulas = await excelManager.getCellFormulas(args.worksheetName); return { success: true, data: formulas }; } catch (error) { return { success: false, error: error instanceof Error ? error.message : String(error) }; } }
  • Core implementation that traverses the worksheet rows and cells to collect all formulas into a dictionary by cell address
    async getCellFormulas(worksheetName: string): Promise<{ [cell: string]: string }> { if (!this.workbook) { throw new Error('No workbook is currently open'); } const worksheet = this.workbook.getWorksheet(worksheetName); if (!worksheet) { throw new Error(`Worksheet "${worksheetName}" not found`); } const formulas: { [cell: string]: string } = {}; worksheet.eachRow((row) => { row.eachCell((cell) => { if ((cell as any).formula) { formulas[cell.address] = (cell as any).formula; } }); }); return formulas;
  • src/index.ts:32-44 (registration)
    Main tools registry where excelTools (containing excel_get_formulas) is included in the allTools array used by the MCP server
    const allTools = [ ...excelTools, ...financialTools, ...rentalTools, ...expenseTools, ...reportingTools, ...cashFlowTools, ...taxTools, ...analyticsTools, ...chartTools, ...complianceTools, ...propertyTools, ];

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