search_taxlaw_all
Search Korean tax law data from the National Tax Service: statutes, interpretations, precedents, forms, publications, and Hometax consultation cases.
Instructions
국세법령정보시스템 통합검색. 법제처 API에 없는 국세청 자료까지 보완 탐색: 별표서식, 국세법령, 세법해석/질의, 판례·결정례, 발간책자, 홈택스 상담사례. korean-law-mcp(법제처 DB)와 병용 권장 — 법조문 본문은 korean-law-mcp의 get_law_text가 정확하고, 본 도구의 statute 컬렉션은 메타·인용 위주.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | 검색어. 예: 업무용승용차, 법인세 접대비 | |
| collections | No | 검색 컬렉션. all=전체, appendForm=별표서식, statute=국세법령, question=세법해석/질의, precedent=판례·결정례, formerLibrary=발간책자, hometaxCnslThan=홈택스 상담사례 | all |
| displayPerCollection | No | ||
| page | No | ||
| sort | No | score | |
| fromDate | No | 검색 시작일 YYYYMMDD | |
| toDate | No | 검색 종료일 YYYYMMDD | |
| taxLawCode | No | 세목 코드. 예: 303=법인세, 305=종합소득세 | |
| synonym | No | 동의어 검색 사용 여부 |
Implementation Reference
- src/index.ts:431-457 (registration)Tool definition/registration in the tools array. Defines the name, description, and JSON schema for 'search_taxlaw_all' tool.
{ 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, }, }, - src/index.ts:1089-1163 (handler)Handler function that executes the 'search_taxlaw_all' tool logic. It validates inputs, constructs API parameters, calls the NTS integrated search action (ASEISA001MR01), and formats results per collection.
async function searchTaxlawAll(args: IntegratedSearchArgs): Promise<ToolResponse> { const query = requireString("query", args.query) validateDateRange(args.fromDate, args.toDate) const collections = integratedCollections(args.collections) const display = asPositiveInt(args.displayPerCollection, 3, 10) const page = asPositiveInt(args.page, 1) const sort = integratedSort(args.sort) const params: AnyRecord = { schVcb: query, startCount: page, collection: collections.join(","), wnKey: "", searchType: "", sortField: sort, viewCount: String(display), ntstTlawClCdList: args.taxLawCode ? [args.taxLawCode] : [], icldVcbCtl: [], exclVcbCtl: [], rltnStttCtl: [], schDtBase: "", prtsSprcChiefJdgmYn: "", prtsAttrYrCtl: [], prtsPrgrStatCtl: [], prtsLwsDfntYn: "", mainIdCtl: [], useSynonymYn: args.synonym ? "Y" : "N", } if (args.fromDate) params.bltnStrtDtm = `${args.fromDate}000000` if (args.toDate) params.bltnEndDtm = `${args.toDate}999999` const data = await postTaxlawAction<IntegratedSearchData>( "ASEISA001MR01", params, `/is/USEISA001M.do?schVcb=${encodeURIComponent(query)}`, ) const search = data.ASEISA001MR01.searchResultVO const list = search?.collectionList || [] const total = list.reduce((sum, col) => sum + Number(col.totalCount || 0), 0) if (total === 0) { return notFoundResponse(`국세법령정보시스템 통합검색 '${query}' 결과가 없습니다.`, [ "검색어를 더 짧게 줄여 재검색하세요.", "세법해석/판례만 필요하면 search_taxlaw_documents를 사용하세요.", "법제처 해석례·감사원 심사청구·납세자보호위원회 심의사례·평가심의사례는 통합검색에 포함되지 않습니다. list_taxlaw_site_menus에서 actionId를 확인 후 call_taxlaw_action으로 조회하세요.", "법조문 본문 자체가 필요한 경우 NTS의 statute 컬렉션은 본문 인덱싱이 약하므로 korean-law-mcp의 search_law + get_law_text(jo=...)로 직접 조회하는 것이 확실합니다.", "판례·해석례·조세심판이 NTS에 없으면 korean-law-mcp의 search_decisions(domain=precedent/interpretation/tax_tribunal)도 함께 시도하세요(두 시스템은 인덱싱 범위가 달라 한쪽만 회수되는 경우가 흔함).", ]) } const lines = [ `국세법령정보시스템 통합검색 결과: "${query}"`, `출처: ${TAXLAW_BASE}/is/USEISA001M.do`, `검색 컬렉션: ${collections.join(", ")} / 총 ${total.toLocaleString()}건 / page=${page}`, "주의: 아래 결과는 국세법령정보시스템 action.do 응답에서 온 실제 항목만 표시합니다.", "", ] for (const collection of list) { const nameKr = collection.nameKr || collection.nameEn || "컬렉션" const nameEn = collection.nameEn || "" const count = Number(collection.totalCount || 0) lines.push(`## ${nameKr}${nameEn ? ` (${nameEn})` : ""}: ${count.toLocaleString()}건`) const rows = collection.resultList || [] if (rows.length === 0) { lines.push("[NOT_FOUND] 이 컬렉션의 표시 가능한 결과가 없습니다.", "") continue } rows.slice(0, display).forEach((row) => { lines.push(formatIntegratedRow(row, nameEn), "") }) } return textResponse(truncate(lines.join("\n"), 50000)) } - src/index.ts:44-54 (schema)TypeScript interface defining the input arguments schema for search_taxlaw_all.
interface IntegratedSearchArgs { query?: string collections?: string[] | string displayPerCollection?: number page?: number sort?: string fromDate?: string toDate?: string taxLawCode?: string synonym?: boolean } - src/index.ts:1880-1885 (handler)Call routing in handleToolCall: dispatches the 'search_taxlaw_all' name to the searchTaxlawAll handler function.
async function handleToolCall(name: string, args: unknown): Promise<ToolResponse> { try { const input = (args || {}) as AnyRecord if (name === "search_taxlaw_all") { return await searchTaxlawAll(input as IntegratedSearchArgs) } - src/index.ts:732-746 (helper)Helper function used by searchTaxlawAll to parse and validate the 'collections' parameter.
function integratedCollections(raw: unknown): string[] { const values = Array.isArray(raw) ? raw.map(String) : raw ? [String(raw)] : ["all"] if (values.includes("all")) return [...INTEGRATED_COLLECTIONS] const allowed = new Set<string>(INTEGRATED_COLLECTIONS) const invalid = values.filter((value) => !allowed.has(value)) if (invalid.length > 0) { throw new TaxlawMcpError(`Unknown collection: ${invalid.join(", ")}`, ErrorCodes.INVALID_PARAM) } return [...new Set(values)] }