Skip to main content
Glama

residency_check

Read-onlyIdempotent

Check Korean tax residency with a 3-step rule-based test—domestic law, dual residence, and treaty tie-breaker—and return final status with case notes.

Instructions

Korean tax residency test in 3 steps: domestic law, dual residence, treaty tie-breaker; rule-based, no network. 비거주자·거주자 3단계 판정 (규칙 기반, 외부 호출 없이 동작).

언제: 판정 입력 데이터로 거주자·비거주자·이중거주자·조세조약 tie-break 결과를 즉시 확인할 때. 판단은 코드 규칙 기반 — Solar 키 없어도 동작. AI 판단 기본은 사용자 AI(호스트)가 수행 — 판정 코드는 고정. 반환: {입력, 법리, 1단계(소득세법), 2단계(이중거주자), 3단계(조세조약 tie-break), 최종 판정, 유사 판례 top3, 판단이 갈리는 지점·추가 확인 사항, 주의}. 읽기 전용, 외부 호출 없음(tax_treaty는 선택 호출, 실패 시 mock 안내 첨부).

판단 순서: (1) 소득세법 §1의2·시행령 제2조(제1항·제3항·제4항)·§3·§4 → 주소/거소/파견 특례 → 거주자·비거주자·판단 보류 (2) 이중거주자 여부 (증명책임: 납세의무자, 대법원 2006두3964) (3) 조세조약 tie-break (항구적 주거 → 중대한 이해관계 중심지 → 일상적 거소 → 국적 → 상호합의)

  • 상대국이 주어지면 tax_treaty(country, keyword='거주자')로 조약 거주자 조문 번호·tie-break 원문 일부를 첨부한다. (오프라인/모의 환경에서는 treaty_country만 있으면 조약 체결국임을 전제하고 mock tie-break 원문을 첨부한다.)

  • rules.md의 유사 판례(사실관계 키워드 매칭 상위 3건, 판결요지 요약)를 첨부한다.

  • rules.md 6-4절(찾지 못함/추정) 판례는 인용하지 않는다.

  • 법리: 국내 생활관계만으로 판단(국내외 비교 아님, 대법원 92누11695)을 결과에 명시한다.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "judgment_year": "<judgment_year>"
    },
    "name": "residency_check"
  }
}

Input Schema

NameRequiredDescriptionDefault
langNoOutput language. 'en': English keys and labels, official English texts where available (tax treaties, statutes), other Korean texts returned with a host_ai_translate instruction (your AI translates); Solar machine translation only when UPSTAGE_API_KEY or on-prem Solar is configured. 기본 'ko'ko
notesNo추가 참고사항.
asset_descNo국내 자산 요약 (예: '서울 아파트 자가(부부 공동명의), 국내 증권사 주식, 성남 상가 임대').
exit_datesNo출국 날짜 목록(YYYY-MM-DD). entry_dates와 1:1 대응.
entry_datesNo입국 날짜 목록(YYYY-MM-DD). 제공 시 입국 다음날~출국일로 체류일수 자동 계산.
family_descNo국내 가족 상황 설명 (예: '배우자·자녀 2명 서울 거주, 자녀 국내 학교 재학').
nationalityNo국적 (조약 tie-break 4단계). 미입력 시 4단계 보류 → 판정 보류.미입력
dispatch_descNo파견/현지채용 상세 (예: 'S국 현지법인에 2018년 파견' 또는 '미국 현지법인에 퇴직 후 Senior Director로 신규 채용').
judgment_yearYes판정 대상 연도 (소득 지급 연도). 예: 2026
habitual_abodeNo일상적 거소.판단 보류
permanent_homeNo항구적 주거 소재. 단기체류용이 아닌 계속 사용 가능한 주거 (소유·임차 무관).없음
treaty_countryNo상대국 이름(한글). 예: '미국', '일본', '사우디아라비아'. 모르면 빈 문자열.
domestic_assetsNo국내 부동산·예금·사업용 자산 등 국내 소재 자산이 있는지 여부.
family_in_koreaNo국내에 생계를 같이하는 가족이 있는지 여부.
overseas_job_descNo해외 근무 형태 종합 설명.
domestic_stay_daysNo직전연도(판정 연도-1) 국내 체류일수. 직접 입력값. entry_dates를 제공하면 자동 계산이 우선.
job_needs_183_daysNo국내 183일 이상 거주를 통상 필요로 하는 직업인지 여부 (시행령 제2조제3항제1호).
foreign_nationalityNo외국 국적이 있는지 여부.
permanent_home_descNo항구적 주거 상세 (예: '국내: 서울 아파트 자가(부부 공동), 국외: S국 아파트 임차(실사용 낮음)').
temporary_exit_daysNo관광·질병 치료 등 명백히 일시적인 출국 기간 합계(일). 시행령 제4조제2항에 따라 국내 거소로 간주.
temporary_exit_reasonNo일시적 출국 사유 (예: '관광 5일, 치료 3일').
economic_activity_descNo경제활동 요약 (예: '국내 A건설 자문·임원 근로소득, 국내 C컨설팅 사업, 국내 B법인 배당').
local_hire_not_dispatchNo해외 현지법인에 '파견'이 아니라 퇴직 후 현지 채용된 경우 (§3 미적용, 대법원 2010두15056 구조).
foreign_nationality_descNo외국 국적·영주권 상세 (예: '미국 국적, 2015년 미국 영주권 취득').
public_official_overseasNo공무원으로서 국외 근무 중인지 여부 (시행령 §3 특례 적용 대상).
center_of_vital_interestsNo중대한 이해관계의 중심지(판례상 양국 사업규모·소득규모·체류일수 등 비교).판단 보류
domestic_business_activityNo국내 사업·경영 활동, 국내 사업자등록, 국내 근로소득 등 국내 경제활동 유무.
treaty_country_is_residentNo상대국 국내법상 거주자로 취급되는지 여부.
foreign_permanent_residencyNo외국 영주권 또는 그에 준하는 장기체류자격을 얻었는지 여부 (시행령 제2조제4항).
dispatched_by_korean_companyNo내국법인(100% 출자 현지법인 포함) 파견 여부 (시행령 §3 특례 적용 대상).
treaty_country_resident_descNo상대국 거주자 근거 (예: '미국 영주권자로서 미국 세법 거주지 테스트 충족').

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.12.10
    • changedInput schema / properties / foreign_permanent_residency / description
      Previous value: -"외국 영주권 또는 그에 준하는 장기체류자격을 얻었는지 여부 (시행령 §2④)."New value: +"외국 영주권 또는 그에 준하는 장기체류자격을 얻었는지 여부 (시행령 제2조제4항)."
    • changedInput schema / properties / job_needs_183_days / description
      Previous value: -"국내 183일 이상 거주를 통상 필요로 하는 직업인지 여부 (시행령 §2③1)."New value: +"국내 183일 이상 거주를 통상 필요로 하는 직업인지 여부 (시행령 제2조제3항제1호)."
    • changedInput schema / properties / temporary_exit_days / description
      Previous value: -"관광·질병 치료 등 명백히 일시적인 출국 기간 합계(일). 시행령 §4②에 따라 국내 거소로 간주."New value: +"관광·질병 치료 등 명백히 일시적인 출국 기간 합계(일). 시행령 제4조제2항에 따라 국내 거소로 간주."
  2. Addedv0.9.1

TDQS

A3.8/5.0
Behavior4/5

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

The annotations already cover safety (readOnly, idempotent, non-destructive), but the description adds real behavioral context: fixed rule-based logic with no Solar API key required, an output structure annotated field by field, a mock fallback when the optional tax_treaty call fails, suppression of unreliable case citations from rules.md section 6-4, and the rule that a missing nationality forces a hold. The only wrinkle is the 'no network' phrasing (outside 호출 없음) sitting against openWorldHint=true; the description qualifies it via the optional tax_treaty call, so this is a tension to clarify rather than a contradiction.

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

Conciseness3/5

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

The material is front-loaded and labeled with '언제' and '반환' headers, which helps scanning. However, it duplicates content in English and Korean (the three-step framing and the no-external-call claim appear twice), and repeats the offline/no-network point again in the return section. Roughly a third of the text could be removed without losing information.

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

Completeness4/5

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

With no output schema, the description carries the burden of explaining returns and does so by listing every result component (input, legal basis, three stages, final determination, top-3 cases, divergence points, cautions), plus the burden-of-proof authority and the legal principle that only domestic living relationships are compared. For a 31-parameter tool this is nearly sufficient; what is missing is how partial or conflicting inputs degrade into a hold versus a determination.

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

Parameters3/5

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

Schema description coverage is 100% across 31 parameters, so the schema already explains each field, including the step-4 tie-break role of nationality and the statutory basis for job_needs_183_days. The description's three-stage ordering largely restates those same mappings at the algorithm level rather than adding new per-parameter meaning. It is an adequate complement, not a compensating one.

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

Purpose4/5

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

The opening states a specific verb and resource — a Korean tax residency test — and enumerates its three stages (domestic law, dual residence, treaty tie-breaker) plus the non-obvious trait that it is rule-based rather than AI-driven. An agent can tell this is the deterministic adjudication engine rather than a narrative report or a treaty lookup. It does not name or differentiate itself from the nearby residency_report tool, which is the one clear gap.

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

Usage Guidelines4/5

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

The '언제' line gives an explicit trigger: when you already have judgment input data and want an immediate resident/non-resident/dual-resident/tie-break result. The description also clarifies that the calling host AI performs the interpretive reasoning while this tool fixes the adjudication code, which effectively says when to lean on it versus reasoning manually. It stops short of naming alternatives (e.g. residency_report) or stating when not to use it.

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