excel_create_formula_reference
Generate formula reference sheets with accounting standards and links to support financial calculations and Excel workflows.
Instructions
Create a comprehensive formula reference sheet with accounting standards and links
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| worksheetName | No | Formula Reference |
Implementation Reference
- src/tools/excel-tools.ts:573-596 (handler)The handler function that implements the core logic of the 'excel_create_formula_reference' tool. It generates formula documentation data using FormulaGenerator, adds a new worksheet, writes the data, auto-fits columns, and returns success status.handler: async (args: any): Promise<ToolResult> => { try { const referenceData = FormulaGenerator.createFormulaDocumentationSheet(); const worksheetName = args.worksheetName || "Formula Reference"; await excelManager.addWorksheet(worksheetName); await excelManager.writeWorksheet(worksheetName, referenceData); await excelManager.autoFitColumnWidths(worksheetName, { minWidth: 50, maxWidth: 400 }); return { success: true, message: `Created formula reference sheet: ${worksheetName}`, data: { formulaCount: referenceData.length - 6, // Exclude headers and notes worksheetName } }; } catch (error) { return { success: false, error: error instanceof Error ? error.message : String(error) }; } }
- src/tools/excel-tools.ts:567-572 (schema)The input schema for the tool, specifying an optional worksheetName parameter with default value 'Formula Reference'.inputSchema: { type: "object", properties: { worksheetName: { type: "string", default: "Formula Reference" } } },
- src/tools/excel-tools.ts:564-597 (registration)The complete tool registration object within the exported excelTools array, including name, description, schema, and handler reference.{ name: "excel_create_formula_reference", description: "Create a comprehensive formula reference sheet with accounting standards and links", inputSchema: { type: "object", properties: { worksheetName: { type: "string", default: "Formula Reference" } } }, handler: async (args: any): Promise<ToolResult> => { try { const referenceData = FormulaGenerator.createFormulaDocumentationSheet(); const worksheetName = args.worksheetName || "Formula Reference"; await excelManager.addWorksheet(worksheetName); await excelManager.writeWorksheet(worksheetName, referenceData); await excelManager.autoFitColumnWidths(worksheetName, { minWidth: 50, maxWidth: 400 }); return { success: true, message: `Created formula reference sheet: ${worksheetName}`, data: { formulaCount: referenceData.length - 6, // Exclude headers and notes worksheetName } }; } catch (error) { return { success: false, error: error instanceof Error ? error.message : String(error) }; } } },
- The key helper method FormulaGenerator.createFormulaDocumentationSheet() that generates the detailed formula reference data table used by the tool handler.static createFormulaDocumentationSheet(): Array<Array<string | CellValue>> { return [ ['FINANCIAL FORMULA REFERENCE', '', '', '', '', ''], ['Generated by Excel Finance MCP', '', '', '', '', ''], ['', '', '', '', '', ''], ['Formula Name', 'Excel Formula', 'Description', 'Accounting Standard', 'Reference', 'Validation Notes'], // Investment Analysis ['NPV (Net Present Value)', '=NPV(rate,cash_flows)-initial_investment', 'Present value of future cash flows discounted at specified rate', 'GAAP Capital Investment Analysis', 'https://www.fasb.org/page/PageContent?pageId=/standards/concepts-statements/concept-7.html', 'Rate should be WACC or required return'], ['IRR (Internal Rate of Return)', '=IRR(cash_flows)', 'Discount rate that makes NPV equal to zero', 'GAAP Capital Investment Analysis', 'https://www.fasb.org/page/PageContent?pageId=/standards/concepts-statements/concept-7.html', 'Compare to WACC for investment decisions'], ['Loan Payment (PMT)', '=PMT(rate/12,periods,-principal)', 'Monthly payment for loan amortization', 'GAAP ASC 835 Interest', 'https://www.fasb.org/page/PageContent?pageId=/asc/835/835-20.html', 'Use monthly rate (annual rate / 12)'], // Depreciation ['Straight-Line Depreciation', '=(cost-salvage)/life', 'Equal annual depreciation over useful life', 'GAAP ASC 360 Property, Plant & Equipment', 'https://www.fasb.org/page/PageContent?pageId=/asc/360/360-10-35.html', 'Most common method, required cost > salvage'], ['Double Declining Balance', '=cost*rate*(1-rate)^(year-1)', 'Accelerated depreciation method', 'GAAP ASC 360 Property, Plant & Equipment', 'https://www.fasb.org/page/PageContent?pageId=/asc/360/360-10-35.html', 'Rate = 2/useful life, cannot depreciate below salvage'], // Liquidity Ratios ['Current Ratio', '=current_assets/current_liabilities', 'Short-term liquidity measurement', 'GAAP ASC 210 Balance Sheet', 'https://www.fasb.org/page/PageContent?pageId=/asc/210/210-10.html', 'Ratio > 1.0 good, > 2.0 may indicate excess cash'], ['Quick Ratio (Acid Test)', '=(current_assets-inventory)/current_liabilities', 'Immediate liquidity excluding inventory', 'GAAP ASC 210 Balance Sheet', 'https://www.fasb.org/page/PageContent?pageId=/asc/210/210-10.html', 'More conservative than current ratio'], ['Cash Ratio', '=cash_and_equivalents/current_liabilities', 'Most conservative liquidity measure', 'GAAP ASC 305 Cash and Cash Equivalents', 'https://www.fasb.org/page/PageContent?pageId=/asc/305/305-10.html', 'Only most liquid assets considered'], // Profitability Ratios ['Gross Margin %', '=(revenue-cogs)/revenue*100', 'Profitability after direct costs', 'GAAP Revenue Recognition ASC 606', 'https://www.fasb.org/page/PageContent?pageId=/asc/606/606-10.html', 'Industry comparison important'], ['Operating Margin %', '=operating_income/revenue*100', 'Operational efficiency measure', 'GAAP ASC 220 Income Statement', 'https://www.fasb.org/page/PageContent?pageId=/asc/220/220-10.html', 'Excludes financing and tax effects'], ['Net Margin %', '=net_income/revenue*100', 'Bottom-line profitability measure', 'GAAP ASC 220 Income Statement', 'https://www.fasb.org/page/PageContent?pageId=/asc/220/220-10.html', 'Final profitability after all expenses'], ['Return on Assets (ROA) %', '=net_income/total_assets*100', 'Asset utilization efficiency', 'SEC Financial Analysis Requirements', 'https://www.sec.gov/files/aqfs.pdf', 'Compare to industry and cost of capital'], ['Return on Equity (ROE) %', '=net_income/shareholders_equity*100', 'Return to equity investors', 'SEC Financial Analysis Requirements', 'https://www.sec.gov/files/aqfs.pdf', 'Should exceed cost of equity'], // Leverage Ratios ['Debt-to-Equity', '=total_debt/total_equity', 'Financial leverage measurement', 'GAAP ASC 470 Debt', 'https://www.fasb.org/page/PageContent?pageId=/asc/470/470-10.html', 'Lower ratios indicate less financial risk'], ['Debt-to-Assets', '=total_debt/total_assets', 'Proportion of assets financed by debt', 'GAAP ASC 470 Debt', 'https://www.fasb.org/page/PageContent?pageId=/asc/470/470-10.html', 'Should align with industry standards'], ['Interest Coverage', '=ebit/interest_expense', 'Ability to service interest payments', 'GAAP ASC 470 Debt', 'https://www.fasb.org/page/PageContent?pageId=/asc/470/470-10.html', 'Higher ratios indicate lower default risk'], // Real Estate Specific ['Cap Rate %', '=noi/property_value*100', 'Real estate investment return measure', 'Real Estate Investment Analysis', 'https://www.appraisalinstitute.org/education/', 'Compare to market cap rates for similar properties'], ['Cash-on-Cash Return %', '=annual_cash_flow/cash_invested*100', 'Return on actual cash invested', 'Real Estate Investment Analysis', 'https://www.reit.com/investing/measuring-reit-performance', 'Excludes financing leverage effects'], ['Debt Service Coverage (DSCR)', '=noi/annual_debt_service', 'Ability to service debt from property income', 'Banking/Lending Standards', 'https://www.occ.gov/publications-and-resources/publications/commercial-real-estate/', 'DSCR > 1.25 typically required by lenders'], ['Gross Rent Multiplier', '=property_value/gross_annual_rent', 'Property valuation relative to rent', 'Real Estate Investment Analysis', 'https://www.appraisalinstitute.org/education/', 'Lower GRM may indicate better value'], // Cash Flow Analysis ['Operating Cash Flow Margin', '=operating_cash_flow/revenue*100', 'Cash generation from operations', 'GAAP ASC 230 Statement of Cash Flows', 'https://www.fasb.org/page/PageContent?pageId=/asc/230/230-10.html', 'Higher margins indicate quality earnings'], ['Free Cash Flow', '=operating_cash_flow-capital_expenditures', 'Cash available after necessary investments', 'GAAP ASC 230 Statement of Cash Flows', 'https://www.fasb.org/page/PageContent?pageId=/asc/230/230-10.html', 'Positive FCF indicates financial flexibility'], ['Cash Conversion Cycle', '=dso+days_inventory_outstanding-days_payable_outstanding', 'Time to convert investments to cash', 'Working Capital Management', 'https://www.imanet.org/insights-and-trends/management-accounting/', 'Shorter cycles indicate efficient working capital management'], // Working Capital ['Working Capital', '=current_assets-current_liabilities', 'Short-term operational liquidity', 'GAAP ASC 210 Balance Sheet', 'https://www.fasb.org/page/PageContent?pageId=/asc/210/210-10.html', 'Positive indicates ability to meet obligations'], ['Working Capital Ratio', '=current_assets/current_liabilities', 'Same as current ratio', 'GAAP ASC 210 Balance Sheet', 'https://www.fasb.org/page/PageContent?pageId=/asc/210/210-10.html', 'Benchmark: 1.2 to 2.0 typically healthy'], // Market Valuation ['Price-to-Book', '=market_cap/book_value', 'Market valuation vs accounting book value', 'SEC Market Analysis', 'https://www.sec.gov/files/aqfs.pdf', 'P/B > 1 indicates market premium to book value'], ['Enterprise Value', '=market_cap+total_debt-cash', 'Total company valuation', 'SEC Market Analysis', 'https://www.sec.gov/files/aqfs.pdf', 'Used for acquisition analysis'], ['', '', '', '', '', ''], ['IMPORTANT NOTES:', '', '', '', '', ''], ['1. All formulas follow GAAP/IFRS standards where applicable', '', '', '', '', ''], ['2. Non-GAAP measures must be reconciled to GAAP equivalents', '', '', '', '', ''], ['3. Industry benchmarks should be used for ratio analysis', '', '', '', '', ''], ['4. Formulas assume consistent accounting periods and methods', '', '', '', '', ''], ['5. Professional judgment required for interpretation', '', '', '', '', ''], ['', '', '', '', '', ''], ['For additional guidance, consult:', '', '', '', '', ''], ['- FASB Accounting Standards Codification (ASC)', '', '', '', '', ''], ['- SEC Financial Reporting Guidelines', '', '', '', '', ''], ['- AICPA Professional Standards', '', '', '', '', ''], ['- Industry-specific accounting guidance', '', '', '', '', ''] ]; }
- src/index.ts:32-44 (registration)Final MCP server registration where excelTools (containing excel_create_formula_reference) is spread into the complete allTools array used by the MCP server handlers.const allTools = [ ...excelTools, ...financialTools, ...rentalTools, ...expenseTools, ...reportingTools, ...cashFlowTools, ...taxTools, ...analyticsTools, ...chartTools, ...complianceTools, ...propertyTools, ];