Skip to main content
Glama
boam79

depreciation-mcp

by boam79

업종 간 내용연수·상각 비교

compare_industry_life

Compare standard useful lives and cumulative depreciation for the same asset across industries. Input asset type, cost, and industry codes to see year 1 and year 5 depreciation differences.

Instructions

동일 자산·취득가에 대해 업종별 표준 내용연수 및 1년차·5년 누적 상각(비교용)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
asset_typeYes
costYes
industry_codesYes
methodNo

Implementation Reference

  • Core handler function that compares useful life and depreciation across industries. Iterates over industry_codes, resolves useful life via resolveUsefulLife, computes depreciation schedule via calcDepreciationSchedule, and returns 1st-year and 5-year cumulative depreciation for each industry.
    export function compareIndustryLifeCore(input: {
      asset_type: AssetType;
      cost: number;
      industry_codes: KsicCode[];
      method?: DepreciationMethod;
    }): IndustryComparisonOutput {
      const { asset_type, cost, industry_codes, method } = input;
      if (industry_codes.length === 0) {
        throw new Error("industry_codes에 최소 1개 업종코드가 필요합니다.");
      }
      const comparison: IndustryComparisonOutput["comparison"] = [];
    
      for (const industry_code of industry_codes) {
        const resolved = resolveUsefulLife({ asset_type, industry_code });
        let m: DepreciationMethod = method ?? resolved.default_method;
        if (m === "declining" && getDecliningRate(resolved.standard_life) == null) {
          m = "straight";
        }
        const schedule = calcDepreciationSchedule({
          asset_name: "comparison",
          cost,
          acquired_date: "2026-01-01",
          method: m,
          useful_life_years: resolved.standard_life,
        });
        const y1 = schedule.annual_schedule.find((r) => r.year === 2026)?.depreciation ?? 0;
        let total5 = 0;
        for (let y = 2026; y <= 2030; y++) {
          total5 += schedule.annual_schedule.find((r) => r.year === y)?.depreciation ?? 0;
        }
        comparison.push({
          industry_code,
          industry_name: KSIC_NAMES[industry_code] ?? industry_code,
          useful_life: resolved.standard_life,
          method: m,
          annual_depreciation_yr1: Math.round(y1 * 1e6) / 1e6,
          total_5yr_depreciation: Math.round(total5 * 1e6) / 1e6,
          applicable_table: resolved.applicable_table,
        });
      }
    
      return { asset_type, cost, comparison };
    }
  • Output type definition IndustryComparisonOutput: includes asset_type, cost, and an array of per-industry comparison items (industry_code, industry_name, useful_life, method, annual_depreciation_yr1, total_5yr_depreciation, applicable_table).
    export interface IndustryComparisonOutput {
      asset_type: AssetType;
      cost: number;
      comparison: {
        industry_code: KsicCode;
        industry_name: string;
        useful_life: number;
        method: DepreciationMethod;
        annual_depreciation_yr1: number;
        total_5yr_depreciation: number;
        applicable_table: "annex5" | "annex6";
      }[];
    }
  • src/index.ts:245-274 (registration)
    Registers the 'compare_industry_life' tool on the McpServer with inputSchema (asset_type, cost, industry_codes, optional method) and a handler that validates codes then delegates to compareIndustryLifeCore.
    server.registerTool(
      "compare_industry_life",
      {
        title: "업종 간 내용연수·상각 비교",
        description: "동일 자산·취득가에 대해 업종별 표준 내용연수 및 1년차·5년 누적 상각(비교용)",
        inputSchema: {
          asset_type: z.enum(ASSET_ENUM),
          cost: z.number(),
          industry_codes: z.array(z.string()).min(1),
          method: z.enum(METHOD_ENUM).optional(),
        },
      },
      async (input) => {
        try {
          const codes = input.industry_codes.filter(isKsicCode);
          if (codes.length !== input.industry_codes.length) {
            return toolError(`industry_codes 검증 실패. 사용 가능: ${listKsicCodes().join(", ")}`);
          }
          const out = compareIndustryLifeCore({
            asset_type: input.asset_type as AssetType,
            cost: input.cost,
            industry_codes: codes,
            method: input.method as DepreciationMethod | undefined,
          });
          return { content: [{ type: "text", text: jsonText(out) }] };
        } catch (e) {
          return toolError(e instanceof Error ? e.message : String(e));
        }
      },
    );
  • Input schema definition for the tool using Zod: asset_type (enum), cost (number), industry_codes (array of strings, min 1), optional method (enum).
    inputSchema: {
      asset_type: z.enum(ASSET_ENUM),
      cost: z.number(),
      industry_codes: z.array(z.string()).min(1),
      method: z.enum(METHOD_ENUM).optional(),
    },
  • Imports used by compareIndustryLifeCore: resolveUsefulLife, calcDepreciationSchedule, types, KSIC_NAMES mapping, and getDecliningRate.
    import { resolveUsefulLife } from "./resolveUsefulLife.js";
    import { calcDepreciationSchedule } from "./schedule.js";
    import type { AssetType, DepreciationMethod, KsicCode } from "../types/index.js";
    import { KSIC_NAMES } from "../data/ksicMapping.js";
    import { getDecliningRate } from "../data/decliningRates.js";
    
    export interface IndustryComparisonOutput {
      asset_type: AssetType;
      cost: number;
      comparison: {
        industry_code: KsicCode;
        industry_name: string;
        useful_life: number;
        method: DepreciationMethod;
        annual_depreciation_yr1: number;
        total_5yr_depreciation: number;
        applicable_table: "annex5" | "annex6";
      }[];
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, and the description only states what the tool does without disclosing behavioral traits such as output format, precision, or any side effects. The description does not compensate for the missing annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence that front-loads the purpose. However, it could be slightly more structured by including parameter information without being overly verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and no annotations, the description lacks completeness. It does not explain the output format, how results are presented for multiple industries, or additional context needed for correct usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 0% description coverage, and the description only vaguely mentions 'asset and acquisition cost' and 'by industry', failing to provide meaningful details about the four parameters, their enumerations, or how to use them.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The title and description explicitly state the tool compares standard useful life and depreciation across industries for a given asset and cost. It clearly differentiates from siblings like calc_depreciation_schedule (full schedule) and get_useful_life (single value).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the use case of cross-industry comparison but provides no explicit guidance on when to use this tool versus alternatives, nor any exclusions or prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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/boam79/depreciation-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server