get_taxlaw_hometax_counsel_text
Retrieve the full text of a specific home tax counsel case from the National Tax Service database using the ID obtained from search results.
Instructions
국세법령정보시스템 홈택스 상담사례 상세 조회. search_taxlaw_all의 hometaxCnslThan 결과 ID/REQ_STD_ID를 사용.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | 통합검색 홈택스 상담사례 결과의 ID 또는 REQ_STD_ID. 예: 369 |
Implementation Reference
- src/index.ts:1393-1422 (handler)The handler function `getTaxlawHometaxCounselText` that executes the tool logic. It takes an `id` parameter, calls the ASEISA004MR01 action on the taxlaw API, and formats the response (title, type, date, answer content).
async function getTaxlawHometaxCounselText(args: HometaxCounselArgs): Promise<ToolResponse> { const id = requireString("id", args.id) const referer = `/is/USEISA004P.do?reqStdId=${encodeURIComponent(id)}` const data = await postTaxlawAction<HometaxCounselData>( "ASEISA004MR01", { reqStdId: id }, referer, ) const item = data.ASEISA004MR01 if (!item || !item.reqStdId) { return notFoundResponse(`국세법령정보시스템 홈택스 상담사례 상세를 찾을 수 없습니다: ${id}`, [ "search_taxlaw_all에서 hometaxCnslThan 결과의 ID를 다시 확인하세요.", ]) } const answer = cleanText(item.answerStdContent) const lines = [ `=== ${cleanText(item.stdTitle) || "(제목 없음)"} ===`, "", "기본 정보:", ` ID: ${item.reqStdId}`, ` 상담유형: ${cleanText(item.reqTpNm) || "N/A"}`, ` 등록일자: ${normalizeDate(item.regstDt)}`, ` 출처: ${TAXLAW_BASE}${referer}`, "", "답변:", answer || "N/A", ] return textResponse(truncate(lines.join("\n"), 30000)) } - src/index.ts:116-118 (schema)The `HometaxCounselArgs` interface that defines the input schema for the tool, accepting an optional `id` string.
interface HometaxCounselArgs { id?: string } - src/index.ts:294-304 (schema)The `HometaxCounselData` and `HometaxCounselItem` interfaces that define the response data structure from the API (reqStdId, regstDt, reqTpNm, stdTitle, answerStdContent).
interface HometaxCounselData { ASEISA004MR01?: HometaxCounselItem } interface HometaxCounselItem { reqStdId?: string regstDt?: string reqTpNm?: string stdTitle?: string answerStdContent?: string } - src/index.ts:496-506 (registration)The tool registration/definition in the `tools` array, including its name, description, and input JSON schema (requiring an `id` string).
name: "get_taxlaw_hometax_counsel_text", description: "국세법령정보시스템 홈택스 상담사례 상세 조회. search_taxlaw_all의 hometaxCnslThan 결과 ID/REQ_STD_ID를 사용.", inputSchema: { type: "object", properties: { id: { type: "string", description: "통합검색 홈택스 상담사례 결과의 ID 또는 REQ_STD_ID. 예: 369" }, }, required: ["id"], additionalProperties: false, }, }, - src/index.ts:1892-1894 (registration)The routing/registration in `handleToolCall` that dispatches the 'get_taxlaw_hometax_counsel_text' tool name to the handler function.
if (name === "get_taxlaw_hometax_counsel_text") { return await getTaxlawHometaxCounselText(input as HometaxCounselArgs) }