search_taxlaw_publications
Search tax law publications such as tax guides and filing instructions from the Korean National Tax Service's electronic library.
Instructions
국세법령정보시스템 발간책자 검색. 세무안내, 신고안내 등 전자도서관 자료 탐색.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | 제목 검색어 | |
| categoryCode | No | 분야 코드. list_taxlaw_publication_categories로 확인. 미입력/All=전체 | |
| display | No | ||
| page | No |
Implementation Reference
- src/index.ts:109-114 (schema)Input schema for PublicationSearchArgs used by search_taxlaw_publications: query, categoryCode, display, page.
interface PublicationSearchArgs { query?: string categoryCode?: string display?: number page?: number } - src/index.ts:265-292 (schema)Response data interfaces PublicationData and PublicationItem for the publication-related API responses.
interface PublicationData { ASIELA001MR01?: { pageIndex?: number recordCount?: number recordCountPerPage?: number plcnBkDVOList?: PublicationItem[] } ASIELA001MR02?: { plcnBkDVOList?: PublicationItem[] } ASIELA002MR02?: { plcnBkDVOList?: PublicationItem[] } } interface PublicationItem { ntstPlcnBkId?: string ntstSjtClCd?: string ntstSjtClNm?: string ntstPlcnBkTtl?: string ntstJrsdDnoNm?: string ntstPlcnBkDscmCntn?: string | null plcnDt?: string fleId?: string fleSn?: number elctBkFleId?: string elctBkFleSn?: number } - src/index.ts:1831-1860 (handler)searchTaxlawPublications handler: calls ASIELA001MR01 action, enriches items with detail via ASIELA002MR02, and formats results.
async function searchTaxlawPublications(args: PublicationSearchArgs): Promise<ToolResponse> { const params = { ntarClCd: "01", ntstSjtClCd: args.categoryCode || "All", searchKeyword: args.query || "", pageIndex: asPositiveInt(args.page, 1), recordCountPerPage: asPositiveInt(args.display, 20, 50), } const data = await postTaxlawAction<PublicationData>("ASIELA001MR01", params, "/el/USEELA001M.do") const result = data.ASIELA001MR01 const list = result?.plcnBkDVOList || [] const total = Number(result?.recordCount || 0) if (total === 0 || list.length === 0) { return notFoundResponse(`국세법령정보시스템 발간책자 '${args.query || "(전체)"}' 검색 결과가 없습니다.`, [ "list_taxlaw_publication_categories로 분야 코드를 확인하세요.", "query를 비우면 최신 발간책자 목록을 볼 수 있습니다.", ]) } const enrichedList = await Promise.all(list.map(enrichPublicationItem)) const lines = [ "국세법령정보시스템 발간책자 검색 결과", `출처: ${TAXLAW_BASE}/el/USEELA001M.do`, `검색어: ${args.query || "(전체)"} / 분야: ${args.categoryCode || "All"} / 총 ${total.toLocaleString()}건`, "", ] enrichedList.forEach((item) => lines.push(formatPublicationItem(item), "")) return textResponse(truncate(lines.join("\n"), 30000)) } - src/index.ts:1789-1829 (helper)enrichPublicationItem helper: fetches additional detail (fleId, description) for a publication item using ASIELA002MR02.
async function enrichPublicationItem(item: PublicationItem): Promise<PublicationItem> { if (item.fleId || !item.ntstPlcnBkId) return item try { const data = await postTaxlawAction<PublicationData>( "ASIELA002MR02", { ntstPlcnBkId: item.ntstPlcnBkId }, `/el/USEELA002M.do?ntstPlcnBkId=${encodeURIComponent(item.ntstPlcnBkId)}`, ) const detail = data.ASIELA002MR02?.plcnBkDVOList?.[0] if (!detail) return item const merged: Record<string, unknown> = { ...item } for (const [key, value] of Object.entries(detail)) { if (value !== undefined && value !== null && String(value).trim() !== "") { merged[key] = value } } return merged as PublicationItem } catch { return item } } function formatPublicationItem(item: PublicationItem): string { const lines = [ `[${item.ntstPlcnBkId || "N/A"}] ${cleanText(item.ntstPlcnBkTtl) || "N/A"}`, ` 분야: ${cleanText(item.ntstSjtClNm) || item.ntstSjtClCd || "N/A"} / 담당부서: ${cleanText(item.ntstJrsdDnoNm) || "N/A"}`, ` 발간일자: ${normalizeDate(item.plcnDt)} / 파일ID: ${item.fleId || "N/A"} / 파일순번: ${item.fleSn ?? "N/A"} / 전자책파일ID: ${item.elctBkFleId || "N/A"}`, ] if (item.fleId) { const fleSn = item.fleSn !== undefined ? `&fleSn=${encodeURIComponent(String(item.fleSn))}` : "" lines.push(` 다운로드 힌트: ${TAXLAW_BASE}/downloadFile.do?fleId=${encodeURIComponent(item.fleId)}${fleSn}`) } if (item.elctBkFleId) { const fleSn = item.elctBkFleSn !== undefined ? `&fleSn=${encodeURIComponent(String(item.elctBkFleSn))}` : "" lines.push(` 전자책 다운로드 힌트: ${TAXLAW_BASE}/downloadFile.do?fleId=${encodeURIComponent(item.elctBkFleId)}${fleSn}`) } if (item.ntstPlcnBkDscmCntn) lines.push(` 설명: ${truncate(cleanText(item.ntstPlcnBkDscmCntn), 500)}`) return lines.join("\n") } - src/index.ts:430-648 (registration)Tool registration in the tools array: defines name 'search_taxlaw_publications' with description and inputSchema.
const tools = [ { name: "search_taxlaw_all", description: "국세법령정보시스템 통합검색. 법제처 API에 없는 국세청 자료까지 보완 탐색: 별표서식, 국세법령, 세법해석/질의, 판례·결정례, 발간책자, 홈택스 상담사례. korean-law-mcp(법제처 DB)와 병용 권장 — 법조문 본문은 korean-law-mcp의 get_law_text가 정확하고, 본 도구의 statute 컬렉션은 메타·인용 위주.", inputSchema: { type: "object", properties: { query: { type: "string", description: "검색어. 예: 업무용승용차, 법인세 접대비" }, collections: { oneOf: [ { type: "string", enum: ["all", ...INTEGRATED_COLLECTIONS] }, { type: "array", items: { type: "string", enum: ["all", ...INTEGRATED_COLLECTIONS] } }, ], default: "all", description: "검색 컬렉션. all=전체, appendForm=별표서식, statute=국세법령, question=세법해석/질의, precedent=판례·결정례, formerLibrary=발간책자, hometaxCnslThan=홈택스 상담사례", }, displayPerCollection: { type: "number", minimum: 1, maximum: 10, default: 3 }, page: { type: "number", minimum: 1, default: 1 }, sort: { type: "string", enum: ["score", "date_desc"], default: "score" }, fromDate: { type: "string", pattern: "^\\d{8}$", description: "검색 시작일 YYYYMMDD" }, toDate: { type: "string", pattern: "^\\d{8}$", description: "검색 종료일 YYYYMMDD" }, taxLawCode: { type: "string", description: "세목 코드. 예: 303=법인세, 305=종합소득세" }, synonym: { type: "boolean", default: false, description: "동의어 검색 사용 여부" }, }, required: ["query"], additionalProperties: false, }, }, { name: "search_taxlaw_documents", description: "국세법령정보시스템 문서 검색. 세법해석례/질의회신(01-04)과 과세전적부·이의·심사·심판·판례·헌재(05-10)를 검색. 최신 조세심판원 결정례는 NTS가 강세이므로 본 도구 우선; 그래도 없으면 korean-law-mcp의 search_decisions로 병행 확인 권장.", inputSchema: { type: "object", properties: { query: { type: "string", description: "검색어. 비우면 선택 문서유형의 최신순 목록 조회" }, docType: { type: "string", enum: ["all", "interpretations", "disputes", "advance", "reply", "tax_standard", "written", "tax_pre_review", "objection", "review", "tribunal", "precedent", "constitutional", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10"], default: "reply", }, display: { type: "number", minimum: 1, maximum: 50, default: 20 }, page: { type: "number", minimum: 1, default: 1 }, sort: { type: "string", enum: ["date_desc", "date_asc", "reg_desc", "reg_asc"], default: "date_desc" }, fromDate: { type: "string", pattern: "^\\d{8}$", description: "검색 시작일 YYYYMMDD" }, toDate: { type: "string", pattern: "^\\d{8}$", description: "검색 종료일 YYYYMMDD" }, taxLawCode: { type: "string", description: "세목 코드. 예: 303=법인세, 305=종합소득세" }, }, required: [], additionalProperties: false, }, }, { name: "get_taxlaw_document_text", description: "국세법령정보시스템 문서 상세 조회. search_taxlaw_documents/search_taxlaw_all 결과의 DOC_ID/id를 사용.", inputSchema: { type: "object", properties: { id: { type: "string", description: "검색 결과의 DOC_ID 또는 DOCID. 예: 001_200000000000019482 또는 200000000000019482" }, docType: { type: "string", enum: ["advance", "reply", "tax_standard", "written", "tax_pre_review", "objection", "review", "tribunal", "precedent", "constitutional", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10"], description: "알고 있는 경우 문서유형. 미입력 시 질의/판례 상세를 순차 시도" }, full: { type: "boolean", default: false, description: "true면 HTML 원문 변환 텍스트를 더 길게 포함" }, }, required: ["id"], additionalProperties: false, }, }, { 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, }, }, { name: "list_taxlaw_site_menus", description: "국세법령정보시스템 주요 메뉴별 접근 경로와 확인된 action.do 호출 정보를 나열합니다. 고수준 도구가 없는 메뉴는 call_taxlaw_action 또는 get_taxlaw_page_text로 접근합니다.", inputSchema: { type: "object", properties: { query: { type: "string", description: "메뉴명/섹션/키/액션ID 필터. 예: 훈령서식, ASIPDM, 세목별" }, }, required: [], additionalProperties: false, }, }, { name: "call_taxlaw_action", description: "국세법령정보시스템 action.do 원시 호출. list_taxlaw_site_menus의 actionId/defaultParamData 또는 브라우저에서 확인한 actionId를 사용할 수 있습니다.", inputSchema: { type: "object", properties: { actionId: { type: "string", description: "action.do actionId. 예: ASIPDM001MR01" }, paramData: { type: "object", description: "action.do paramData JSON 객체. 미입력 시 {}" }, refererPath: { type: "string", description: "같은 사이트 내 referer 경로. 예: /pd/USEPDM001M.do" }, full: { type: "boolean", default: false, description: "true면 JSON 응답을 더 길게 반환" }, }, required: ["actionId", "refererPath"], additionalProperties: false, }, }, { name: "get_taxlaw_page_text", description: "국세법령정보시스템 HTML/텍스트 페이지를 같은 사이트 경로로 조회해 텍스트로 변환합니다. 정적 자료(예: 세목별요약정보 /html/U_0101.html) 확인용입니다.", inputSchema: { type: "object", properties: { path: { type: "string", description: "같은 사이트 내 경로. 예: /bg/USEBGG001M.do, /html/U_0101.html" }, full: { type: "boolean", default: false }, }, required: ["path"], additionalProperties: false, }, }, { name: "search_taxlaw_interpretations", description: "하위호환용: 세법해석례/질의회신 검색. 내부적으로 search_taxlaw_documents를 사용.", inputSchema: { type: "object", properties: { query: { type: "string" }, docType: { type: "string", enum: ["all", "interpretations", "advance", "reply", "tax_standard", "written", "01", "02", "03", "04"], default: "reply" }, display: { type: "number", minimum: 1, maximum: 50, default: 20 }, page: { type: "number", minimum: 1, default: 1 }, sort: { type: "string", enum: ["date_desc", "date_asc", "reg_desc", "reg_asc"], default: "date_desc" }, fromDate: { type: "string", pattern: "^\\d{8}$" }, toDate: { type: "string", pattern: "^\\d{8}$" }, taxLawCode: { type: "string" }, }, required: [], additionalProperties: false, }, }, { name: "get_taxlaw_interpretation_text", description: "하위호환용: 세법해석례/질의회신 상세 조회. 내부적으로 get_taxlaw_document_text를 사용.", inputSchema: { type: "object", properties: { id: { type: "string" }, full: { type: "boolean", default: false }, }, required: ["id"], additionalProperties: false, }, }, { name: "list_taxlaw_basic_ruling_laws", description: "국세법령정보시스템 기본통칙 법령 목록 조회. get_taxlaw_basic_ruling_text의 lawId 확보용.", inputSchema: { type: "object", properties: { query: { type: "string", description: "법령명 필터. 예: 법인세, 소득세" }, }, required: [], additionalProperties: false, }, }, { name: "get_taxlaw_basic_ruling_text", description: "국세법령정보시스템 기본통칙 본문 조회. list_taxlaw_basic_ruling_laws 결과의 lawId 사용.", inputSchema: { type: "object", properties: { lawId: { type: "string", description: "기본통칙 법령 ID(ntstBscId)" }, year: { type: "string", pattern: "^\\d{4}$", description: "연도. 미입력 시 최신 연도" }, query: { type: "string", description: "통칙 제목/본문 내 필터" }, display: { type: "number", minimum: 1, maximum: 200, default: 30 }, full: { type: "boolean", default: false }, }, required: ["lawId"], additionalProperties: false, }, }, { name: "search_taxlaw_forms", description: "국세법령정보시스템 별표/서식 검색. 전체 서식, 별표, 법령서식, 훈령서식, 자주찾는서식을 탐색.", inputSchema: { type: "object", properties: { query: { type: "string", description: "별표/서식명 검색어" }, kind: { type: "string", enum: ["all", "all_forms", "annex", "form", "legal_form", "instruction_form", "favorite_form"], default: "all" }, lawId: { type: "string", description: "특정 법령 ID(ntstBscId). 미입력 시 전체" }, display: { type: "number", minimum: 1, maximum: 50, default: 20 }, page: { type: "number", minimum: 1, default: 1 }, }, required: [], additionalProperties: false, }, }, { name: "search_taxlaw_publications", description: "국세법령정보시스템 발간책자 검색. 세무안내, 신고안내 등 전자도서관 자료 탐색.", inputSchema: { type: "object", properties: { query: { type: "string", description: "제목 검색어" }, categoryCode: { type: "string", description: "분야 코드. list_taxlaw_publication_categories로 확인. 미입력/All=전체" }, display: { type: "number", minimum: 1, maximum: 50, default: 20 }, page: { type: "number", minimum: 1, default: 1 }, }, required: [], additionalProperties: false, }, }, { name: "list_taxlaw_publication_categories", description: "국세법령정보시스템 발간책자 분야 코드 목록 조회.", inputSchema: { type: "object", properties: {}, required: [], additionalProperties: false, }, }, ]