Skip to main content
Glama

depreciation_macrs

Calculate MACRS depreciation schedules for assets with 3, 5, 7, or 10-year recovery periods to determine tax-deductible depreciation expenses.

Instructions

Calculate MACRS depreciation schedule

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
costYes
recoveryPeriodYesMACRS recovery period in years

Implementation Reference

  • Core handler implementing MACRS depreciation using predefined percentage rates for standard recovery periods (3,5,7,10 years). Returns list of annual depreciation amounts.
    def macrs(cost: float, recovery_period: int) -> List[float]: """Calculate MACRS depreciation (simplified)""" macrs_rates = { 3: [0.3333, 0.4445, 0.1481, 0.0741], 5: [0.2000, 0.3200, 0.1920, 0.1152, 0.1152, 0.0576], 7: [0.1429, 0.2449, 0.1749, 0.1249, 0.0893, 0.0892, 0.0893, 0.0446], 10: [0.1000, 0.1800, 0.1440, 0.1152, 0.0922, 0.0737, 0.0655, 0.0655, 0.0656, 0.0655, 0.0328] } if recovery_period not in macrs_rates: raise ValueError(f"MACRS rates not available for {recovery_period} year period") rates = macrs_rates[recovery_period] return [cost * rate for rate in rates]
  • Registers the MCP tool 'depreciation_macrs' with input schema validation and a handler that delegates execution to the Python DepreciationCalculator.macrs method.
    { name: "depreciation_macrs", description: "Calculate MACRS depreciation schedule", inputSchema: { type: "object", properties: { cost: { type: "number" }, recoveryPeriod: { type: "number", enum: [3, 5, 7, 10], description: "MACRS recovery period in years" } }, required: ["cost", "recoveryPeriod"] }, handler: async (args: any): Promise<ToolResult> => { try { const result = await pythonBridge.callPythonFunction({ module: 'financial_calculations', function: 'DepreciationCalculator.macrs', args: [args.cost, args.recoveryPeriod] }); return result; } catch (error) { return { success: false, error: error instanceof Error ? error.message : String(error) }; } } },
  • Defines the input schema for the tool, specifying 'cost' as number and 'recoveryPeriod' as number enum [3,5,7,10].
    inputSchema: { type: "object", properties: { cost: { type: "number" }, recoveryPeriod: { type: "number", enum: [3, 5, 7, 10], description: "MACRS recovery period in years" } }, required: ["cost", "recoveryPeriod"] },

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