Skip to main content
Glama

calculate_wacc

Calculate the weighted average cost of capital for investment analysis and financial decision making using equity, debt, cost parameters, and tax rate inputs.

Instructions

Calculate Weighted Average Cost of Capital

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
costOfDebtYes
costOfEquityYes
debtValueYes
equityValueYes
taxRateYes

Implementation Reference

  • Tool definition and registration in financialTools array, including input schema and handler that calls Python implementation
    { name: "calculate_wacc", description: "Calculate Weighted Average Cost of Capital", inputSchema: { type: "object", properties: { equityValue: { type: "number" }, debtValue: { type: "number" }, costOfEquity: { type: "number" }, costOfDebt: { type: "number" }, taxRate: { type: "number" } }, required: ["equityValue", "debtValue", "costOfEquity", "costOfDebt", "taxRate"] }, handler: async (args: any): Promise<ToolResult> => { try { const result = await pythonBridge.callPythonFunction({ module: 'financial_calculations', function: 'FinancialCalculator.wacc', args: [args.equityValue, args.debtValue, args.costOfEquity, args.costOfDebt, args.taxRate] }); return result; } catch (error) { return { success: false, error: error instanceof Error ? error.message : String(error) }; } } },
  • Core implementation of WACC calculation using weighted average of cost of equity and after-tax cost of debt
    def wacc(equity_value: float, debt_value: float, cost_of_equity: float, cost_of_debt: float, tax_rate: float) -> float: """Calculate Weighted Average Cost of Capital""" total_value = equity_value + debt_value equity_weight = equity_value / total_value debt_weight = debt_value / total_value return (equity_weight * cost_of_equity) + (debt_weight * cost_of_debt * (1 - tax_rate))
  • src/index.ts:32-44 (registration)
    Aggregation of all tools including financialTools into allTools array used for MCP server tool listing and execution
    const allTools = [ ...excelTools, ...financialTools, ...rentalTools, ...expenseTools, ...reportingTools, ...cashFlowTools, ...taxTools, ...analyticsTools, ...chartTools, ...complianceTools, ...propertyTools, ];
  • Input schema defining parameters for calculate_wacc tool
    inputSchema: { type: "object", properties: { equityValue: { type: "number" }, debtValue: { type: "number" }, costOfEquity: { type: "number" }, costOfDebt: { type: "number" }, taxRate: { type: "number" } }, required: ["equityValue", "debtValue", "costOfEquity", "costOfDebt", "taxRate"] },

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