Skip to main content
Glama

Capital gains tax (양도소득세)

calc_transfer_tax
Read-onlyIdempotent

Calculate South Korea real estate capital gains tax using purchase and sale prices, holding years, expenses, and tax year; returns step-by-step tax and the cited statute trail.

Instructions

Korea capital gains tax (양도소득세) on real estate: rate, long-term holding deduction, heavy rates, surtax. Returns the statute trail.

양도소득세를 계산한다. 세율·공제는 year로 상수표에서 읽는다.

⚠️ 2026-08-30 변경 — year 필수. 세율표·기본공제·중과 가산세율을
data/tax_params.json(1층)에서 읽고, **단기세율 비교과세(§104① 후단·§104⑦ 후단)를
코드가 수행한다.** 종전에는 "두 번 호출해서 큰 쪽을 채택하라"고 호출자에게 넘겼는데,
그건 사람이 빠뜨리는 자리다. year가 검증 안 된 과거 연도면 계산을 거부하고,
미래 연도는 현행법 기준 추정으로 계산하되 결과에 그렇게 표시한다.

asset_type: "주택"(조합원입주권·분양권 포함해 단기세율이 주택등 기준) / "토지" /
"분양권"(보유기간 무관 하한 60%) / "비사업용토지"(기본세율 +10%p).
heavy_home_count: §104⑦ 중과 주택수(조정대상지역 기준). 2면 +20%p, 3 이상이면 +30%p.
surcharge_rate를 직접 주면 그것이 우선한다.

Args:
    purchase_price: 매수 가격 (원)
    sale_price: 매도 가격 (원)
    holding_years: 보유 기간 (년)
    necessary_expenses: 취득세, 중개보수 등 필요경비 (원)
    tax_brackets: [{"upto": 과세표준 상한(원, 마지막 구간은 None), "rate": 세율(0~1), "deduction": 누진공제액(원)}, ...]
                  최신 소득세법 시행령 별표에서 확인해서 넘길 것 — 하드코딩된 기본값 없음
    long_term_deduction_rate: 장기보유특별공제율 (0~1), 다주택 중과 대상이면 0으로 넘길 것
    basic_deduction: 양도소득 기본공제 (기본 250만원, 연 1회)
    surcharge_rate: 다주택자 중과세율 가산분 (0~1), 해당 없으면 0

소득세법 §95②에 따라 §104⑦ 중과대상 주택은 장특공 자체가 배제된다(미등기와 동급) —
surcharge_rate와 long_term_deduction_rate를 동시에 넘기는 조합은 법문상 존재하지 않으므로
거부한다. 장특공은 보유 3년 이상만 가능(§95②).

이 함수가 지원하지 않는 산식 — 호출자가 사전에 처리할 것:
  · 보유 2년 미만 + 중과: max(단기세율 세액, 중과세율 세액) 비교과세(§104⑦ 후단) —
    두 번 호출해서 큰 쪽을 채택
  · 고가주택(양도가액 12억 초과) 1세대1주택: 과세 양도차익 = 전체차익×(양도가액−12억)/양도가액
    (영 §160) — 안분 후의 값을 기준으로 별도 계산 필요
  · 같은 과세기간 2회 이상 양도 시 합산 비교과세(§104⑤)

Returns:
    계산 과정이 담긴 dict (양도차익, 과세표준, 산출세액 등 단계별로 반환 — 검증 가능하도록)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearYes
asset_typeNo주택
sale_priceYes
tax_bracketsNo
holding_yearsYes
purchase_priceYes
surcharge_rateNo
basic_deductionNo
heavy_home_countNo
necessary_expensesYes
long_term_deduction_rateNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description goes well beyond them: it refuses unvalidated past years, flags future years as current-law estimates, rejects the legally impossible surcharge_rate + long_term_deduction_rate combination, and documents the 2026-08-30 behavior change and the data/tax_params.json source.

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?

Front-loads the purpose and the required-year change before the per-argument documentation, and nearly every sentence carries operative detail. The dated changelog block and repeated statutory citations add some verbal bulk that a caller does not strictly need to invoke the tool.

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

Completeness5/5

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

With 11 parameters, no output schema, and 0% schema coverage, the description still covers every argument, the rejection rules, the legal cross-checks (§95②, §104⑦), and the shape of the returned dict (step-by-step so results are verifiable). Nothing needed to call it correctly is missing.

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

Parameters5/5

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

Schema coverage is 0% (bare titles only), so the description must carry the load and it does: it defines units (원, 0~1, 년), the tax_brackets object shape with 'upto'/None-final-segment, defaults (250만원 basic deduction, 0 default surcharge), and enum-like asset_type semantics including 분양권's 60% floor and 비사업용토지's +10%p.

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?

Opens with a specific verb+resource: Korea capital gains tax on real estate, enumerating the computed components (rate, long-term holding deduction, heavy rates, surtax) and the return ('the statute trail'). This is clearly separable from siblings such as calc_acquisition_tax, calc_gift_tax, and calc_inheritance_tax on the resource axis.

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

Usage Guidelines5/5

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

Gives explicit when-to-use conditions (asset_type cases, heavy_home_count multipliers, surcharge_rate precedence) and an explicit when-not section enumerating three formulas the function does not support (sub-2-year holding with heavy rates, high-value single-home apportionment, multi-transfer aggregation) plus handled by the caller workarounds.

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