get_tax_tribunal_decision_text
Retrieve the full text of a Korean tax tribunal decision by its serial number. Use it to access official decision documents for legal research or case review.
Instructions
[조세심판] 조세심판 결정례 전문.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Tax tribunal decision serial number (특별행정심판재결례일련번호) from search results | |
| decisionName | No | Decision name (optional, for verification) | |
| apiKey | No | 법제처 Open API 인증키(OC). 사용자가 제공한 경우 전달 |
Implementation Reference
- Handler function that fetches the full text of a tax tribunal decision by ID from the lawService.do API endpoint (target: ttSpecialDecc). Parses JSON response, formats basic info (case name, number, dates, court) and content (summary, order, reasoning, related statutes) into a readable text output.
export async function getTaxTribunalDecisionText( apiClient: LawApiClient, args: GetTaxTribunalDecisionTextInput ): Promise<{ content: Array<{ type: string, text: string }>, isError?: boolean }> { try { const extraParams: Record<string, string> = { ID: args.id }; if (args.decisionName) extraParams.LM = args.decisionName; const responseText = await apiClient.fetchApi({ endpoint: "lawService.do", target: "ttSpecialDecc", type: "JSON", extraParams, apiKey: args.apiKey, }); let data: any; try { data = JSON.parse(responseText); } catch (err) { throw new Error("Failed to parse JSON response from API"); } if (!data.SpecialDeccService) { throw new Error("Tax tribunal decision not found or invalid response format"); } const decc = data.SpecialDeccService; const basic = { 사건명: decc.사건명, 사건번호: decc.사건번호, 청구번호: decc.청구번호, 처분일자: decc.처분일자, 의결일자: decc.의결일자, 처분청: decc.처분청, 재결청: decc.재결청, 재결례유형명: decc.재결례유형명, 세목: decc.세목 }; const content = { 재결요지: decc.재결요지, 따른결정: decc.따른결정, 참조결정: decc.참조결정, 주문: decc.주문, 청구취지: decc.청구취지, 이유: decc.이유, 관련법령: decc.관련법령 }; let output = `=== ${basic.사건명 || "Tax Tribunal Decision"} ===\n\n`; output += `📋 기본 정보:\n`; output += ` 사건번호: ${basic.사건번호 || "N/A"}\n`; output += ` 청구번호: ${basic.청구번호 || "N/A"}\n`; output += ` 처분일자: ${basic.처분일자 || "N/A"}\n`; output += ` 의결일자: ${basic.의결일자 || "N/A"}\n`; output += ` 처분청: ${basic.처분청 || "N/A"}\n`; output += ` 재결청: ${basic.재결청 || "N/A"}\n`; output += ` 재결유형: ${basic.재결례유형명 || "N/A"}\n`; output += ` 세목: ${basic.세목 || "N/A"}\n\n`; if (content.재결요지) { output += `📌 재결요지:\n${content.재결요지}\n\n`; } if (content.주문) { output += `⚖️ 주문:\n${content.주문}\n\n`; } if (content.청구취지) { output += `📝 청구취지:\n${content.청구취지}\n\n`; } if (content.이유) { output += `📄 이유:\n${content.이유}\n\n`; } if (content.따른결정) { output += `🔗 따른결정:\n${content.따른결정}\n\n`; } if (content.참조결정) { output += `📖 참조결정:\n${content.참조결정}\n\n`; } if (content.관련법령) { output += `📚 관련법령:\n${content.관련법령}\n`; } return { content: [{ type: "text", text: truncateResponse(output) }] }; } catch (error) { return formatToolError(error, "get_tax_tribunal_decision_text"); } } - Zod schema defining the input parameters for getTaxTribunalDecisionText: id (required), decisionName (optional), and apiKey (optional).
export const getTaxTribunalDecisionTextSchema = z.object({ id: z.string().describe("Tax tribunal decision serial number (특별행정심판재결례일련번호) from search results"), decisionName: z.string().optional().describe("Decision name (optional, for verification)"), apiKey: z.string().optional().describe("법제처 Open API 인증키(OC). 사용자가 제공한 경우 전달"), }); - src/tool-registry.ts:332-337 (registration)Registration of the tool in the tool registry with name, description, schema, and handler mapping.
{ name: "get_tax_tribunal_decision_text", description: "[조세심판] 조세심판 결정례 전문.", schema: getTaxTribunalDecisionTextSchema, handler: getTaxTribunalDecisionText }, - src/lib/tool-chain-config.ts:31-35 (helper)Tool chain configuration mapping search_tax_tribunal_decisions to this detail tool, enabling automatic retrieval of full text from search results using the [ID] format.
search_tax_tribunal_decisions: { detailTool: "get_tax_tribunal_decision_text", detailParam: "id", idRegex: BRACKET_ID, },