Skip to main content
Glama

depreciation_straight_line

Calculate straight-line depreciation schedules for assets by entering cost, salvage value, and useful life to determine annual depreciation expense.

Instructions

Calculate straight-line depreciation schedule

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
costYes
salvageValueYes
usefulLifeYesUseful life in years

Implementation Reference

  • Registration of the 'depreciation_straight_line' tool, including input schema, description, and handler function that calls the Python implementation via pythonBridge.
    { name: "depreciation_straight_line", description: "Calculate straight-line depreciation schedule", inputSchema: { type: "object", properties: { cost: { type: "number" }, salvageValue: { type: "number" }, usefulLife: { type: "number", description: "Useful life in years" } }, required: ["cost", "salvageValue", "usefulLife"] }, handler: async (args: any): Promise<ToolResult> => { try { const result = await pythonBridge.callPythonFunction({ module: 'financial_calculations', function: 'DepreciationCalculator.straight_line', args: [args.cost, args.salvageValue, args.usefulLife] }); return result; } catch (error) { return { success: false, error: error instanceof Error ? error.message : String(error) }; } } },
  • Core implementation of straight-line depreciation calculation in Python's DepreciationCalculator class, computing annual depreciation and returning schedule as a list.
    def straight_line(cost: float, salvage_value: float, useful_life: int) -> List[float]: """Calculate straight-line depreciation""" annual_depreciation = (cost - salvage_value) / useful_life return [annual_depreciation] * useful_life
  • Input schema defining parameters for the tool: cost, salvageValue, usefulLife.
    inputSchema: { type: "object", properties: { cost: { type: "number" }, salvageValue: { type: "number" }, usefulLife: { type: "number", description: "Useful life in years" } }, required: ["cost", "salvageValue", "usefulLife"] },

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