Skip to main content
Glama

depreciation_sum_of_years

Calculate sum-of-years-digits depreciation schedules for assets by inputting cost, salvage value, and useful life to determine annual depreciation amounts.

Instructions

Calculate sum-of-years-digits depreciation schedule

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
costYes
salvageValueYes
usefulLifeYes

Implementation Reference

  • Core handler function implementing the sum-of-years-digits depreciation logic, calculating annual depreciation amounts based on the fraction of remaining years over the total sum of years.
    @staticmethod def sum_of_years_digits(cost: float, salvage_value: float, useful_life: int) -> List[float]: """Calculate sum-of-years-digits depreciation""" depreciable_amount = cost - salvage_value sum_of_years = sum(range(1, useful_life + 1)) depreciation_schedule = [] for year in range(useful_life, 0, -1): fraction = year / sum_of_years depreciation = depreciable_amount * fraction depreciation_schedule.append(depreciation) return depreciation_schedule
  • Tool registration including name, description, input schema, and handler that invokes the Python implementation via bridge.
    { name: "depreciation_sum_of_years", description: "Calculate sum-of-years-digits depreciation schedule", inputSchema: { type: "object", properties: { cost: { type: "number" }, salvageValue: { type: "number" }, usefulLife: { type: "number" } }, required: ["cost", "salvageValue", "usefulLife"] }, handler: async (args: any): Promise<ToolResult> => { try { const result = await pythonBridge.callPythonFunction({ module: 'financial_calculations', function: 'DepreciationCalculator.sum_of_years_digits', args: [args.cost, args.salvageValue, args.usefulLife] }); return result; } catch (error) { return { success: false, error: error instanceof Error ? error.message : String(error) }; } } },
  • Input schema defining parameters for cost, salvageValue, and usefulLife.
    inputSchema: { type: "object", properties: { cost: { type: "number" }, salvageValue: { type: "number" }, usefulLife: { type: "number" } }, required: ["cost", "salvageValue", "usefulLife"] },
  • src/index.ts:32-44 (registration)
    Global registration of all tools including financialTools (containing depreciation_sum_of_years) into the MCP server's tool list.
    const allTools = [ ...excelTools, ...financialTools, ...rentalTools, ...expenseTools, ...reportingTools, ...cashFlowTools, ...taxTools, ...analyticsTools, ...chartTools, ...complianceTools, ...propertyTools, ];

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