Skip to main content
Glama

depreciation_units_production

Calculate depreciation expense based on actual production output for assets, using cost, salvage value, and unit data to allocate asset cost over its useful life.

Instructions

Calculate units of production depreciation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
costYes
salvageValueYes
totalUnitsYes
unitsPerPeriodYes

Implementation Reference

  • JS handler that delegates to Python implementation via bridge
    handler: async (args: any): Promise<ToolResult> => { try { const result = await pythonBridge.callPythonFunction({ module: 'financial_calculations', function: 'DepreciationCalculator.units_of_production', args: [args.cost, args.salvageValue, args.totalUnits, args.unitsPerPeriod] }); return result; } catch (error) { return { success: false, error: error instanceof Error ? error.message : String(error) }; } }
  • Input schema defining parameters for units-of-production depreciation calculation
    inputSchema: { type: "object", properties: { cost: { type: "number" }, salvageValue: { type: "number" }, totalUnits: { type: "number" }, unitsPerPeriod: { type: "array", items: { type: "number" } } }, required: ["cost", "salvageValue", "totalUnits", "unitsPerPeriod"] },
  • src/index.ts:32-44 (registration)
    Registration of financialTools (containing the tool) into the main allTools array used by MCP server
    const allTools = [ ...excelTools, ...financialTools, ...rentalTools, ...expenseTools, ...reportingTools, ...cashFlowTools, ...taxTools, ...analyticsTools, ...chartTools, ...complianceTools, ...propertyTools, ];
  • Core Python implementation computing depreciation expense per period based on units produced
    @staticmethod def units_of_production(cost: float, salvage_value: float, total_units: int, units_per_period: List[int]) -> List[float]: """Calculate units of production depreciation""" depreciable_amount = cost - salvage_value rate_per_unit = depreciable_amount / total_units return [units * rate_per_unit for units in units_per_period]

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