search_tax_tribunal_decisions
Search Korean tax tribunal decisions by tax type (customs, income, corporate, VAT) and keywords. Filter by decision dates, disposition dates, or sort results.
Instructions
[조세심판] 조세심판원 결정례 검색. 관세·소득세·법인세·부가세 등 세목별 검색 가능.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Search keyword (e.g., '자동차', '부가가치세') | |
| display | Yes | Results per page (default: 20, max: 100) | |
| page | Yes | Page number (default: 1) | |
| cls | No | Decision type code (재결구분코드) | |
| gana | No | Dictionary search (ga, na, da, etc.) | |
| dpaYd | No | Disposition date range (YYYYMMDD~YYYYMMDD, e.g., '20200101~20201231') | |
| rslYd | No | Decision date range (YYYYMMDD~YYYYMMDD, e.g., '20200101~20201231') | |
| sort | No | Sort option: lasc/ldes (decision name), dasc/ddes (decision date), nasc/ndes (claim number) | |
| apiKey | No | 법제처 Open API 인증키(OC). 사용자가 제공한 경우 전달 |
Implementation Reference
- Main handler function that executes the search logic. Calls the law API (lawSearch.do/ttSpecialDecc), parses XML results via parseTaxTribunalXML, and formats the response listing decisions with case name, claim number, decision date, etc.
export async function searchTaxTribunalDecisions( apiClient: LawApiClient, args: SearchTaxTribunalDecisionsInput ): Promise<{ content: Array<{ type: string, text: string }>, isError?: boolean }> { try { const extraParams: Record<string, string> = { display: (args.display || 20).toString(), page: (args.page || 1).toString(), }; if (args.query) extraParams.query = args.query; if (args.cls) extraParams.cls = args.cls; if (args.gana) extraParams.gana = args.gana; if (args.dpaYd) extraParams.dpaYd = args.dpaYd; if (args.rslYd) extraParams.rslYd = args.rslYd; if (args.sort) extraParams.sort = args.sort; const xmlText = await apiClient.fetchApi({ endpoint: "lawSearch.do", target: "ttSpecialDecc", extraParams, apiKey: args.apiKey, }); // 공통 파서 사용 const result = parseTaxTribunalXML(xmlText); const totalCount = result.totalCnt; const currentPage = result.page; const deccs = result.items; if (totalCount === 0) { return { content: [{ type: "text", text: "검색 결과가 없습니다." }] }; } let output = `조세심판원 재결례 검색 결과 (총 ${totalCount}건, ${currentPage}페이지):\n\n`; for (const decc of deccs) { output += `[${decc.특별행정심판재결례일련번호}] ${decc.사건명}\n`; output += ` 청구번호: ${decc.청구번호 || "N/A"}\n`; output += ` 의결일자: ${decc.의결일자 || "N/A"}\n`; output += ` 처분일자: ${decc.처분일자 || "N/A"}\n`; output += ` 재결청: ${decc.재결청 || "N/A"}\n`; output += ` 재결구분: ${decc.재결구분명 || "N/A"}\n`; if (decc.행정심판재결례상세링크) { output += ` 링크: ${decc.행정심판재결례상세링크}\n`; } output += `\n`; } output += `\n💡 전문을 조회하려면 get_tax_tribunal_decision_text Tool을 사용하세요.\n`; return { content: [{ type: "text", text: output }] }; } catch (error) { return formatToolError(error, "search_tax_tribunal_decisions"); } } - Zod schema defining input parameters: query (optional keyword), display (1-100 results), page, cls (decision type code), gana (dictionary search), dpaYd/rslYd (date ranges), sort (sort option), and apiKey.
export const searchTaxTribunalDecisionsSchema = z.object({ query: z.string().optional().describe("Search keyword (e.g., '자동차', '부가가치세')"), display: z.number().min(1).max(100).default(20).describe("Results per page (default: 20, max: 100)"), page: z.number().min(1).default(1).describe("Page number (default: 1)"), cls: z.string().optional().describe("Decision type code (재결구분코드)"), gana: z.string().optional().describe("Dictionary search (ga, na, da, etc.)"), dpaYd: z.string().optional().describe("Disposition date range (YYYYMMDD~YYYYMMDD, e.g., '20200101~20201231')"), rslYd: z.string().optional().describe("Decision date range (YYYYMMDD~YYYYMMDD, e.g., '20200101~20201231')"), sort: z.enum(["lasc", "ldes", "dasc", "ddes", "nasc", "ndes"]).optional() .describe("Sort option: lasc/ldes (decision name), dasc/ddes (decision date), nasc/ndes (claim number)"), apiKey: z.string().optional().describe("법제처 Open API 인증키(OC). 사용자가 제공한 경우 전달"), }); - src/tool-registry.ts:326-331 (registration)Tool registration entry linking the name 'search_tax_tribunal_decisions' to its schema and handler function.
{ name: "search_tax_tribunal_decisions", description: "[조세심판] 조세심판원 결정례 검색. 관세·소득세·법인세·부가세 등 세목별 검색 가능.", schema: searchTaxTribunalDecisionsSchema, handler: searchTaxTribunalDecisions }, - src/tool-registry.ts:41-42 (registration)Import statement that pulls the searchTaxTribunalDecisions function and its schema from the tax-tribunal-decisions.ts module.
import { searchTaxTribunalDecisions, searchTaxTribunalDecisionsSchema, getTaxTribunalDecisionText, getTaxTribunalDecisionTextSchema } from "./tools/tax-tribunal-decisions.js" import { searchCustomsInterpretations, searchCustomsInterpretationsSchema, getCustomsInterpretationText, getCustomsInterpretationTextSchema } from "./tools/customs-interpretations.js" - src/lib/query-router.ts:364-375 (helper)Query router entry that maps Korean keywords like '조세심판' or '세금심판' to the search_tax_tribunal_decisions tool.
{ name: "tax_tribunal", patterns: [ /조세\s*심판|세금\s*심판/, ], tool: "search_tax_tribunal_decisions", extract: (query) => ({ query: query.replace(/조세심판원?|세금심판|결정례?/g, "").replace(/\s+/g, " ").trim(), }), reason: "조세심판 키워드 → 조세심판 결정례 검색", priority: 10, },