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
| Name | Required | Description | Default |
|---|---|---|---|
| cost | Yes | ||
| salvageValue | Yes | ||
| totalUnits | Yes | ||
| unitsPerPeriod | Yes |
Implementation Reference
- src/tools/financial-tools.ts:479-493 (handler)JS handler that delegates to Python implementation via bridgehandler: 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) }; } }
- src/tools/financial-tools.ts:469-478 (schema)Input schema defining parameters for units-of-production depreciation calculationinputSchema: { 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 serverconst 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]