Skip to main content
Glama

search_taxlaw_interpretations

Search Korean tax law interpretations and official rulings from the National Tax Service database. Filter by document type, date range, and tax law code.

Instructions

하위호환용: 세법해석례/질의회신 검색. 내부적으로 search_taxlaw_documents를 사용.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNo
docTypeNoreply
displayNo
pageNo
sortNodate_desc
fromDateNo
toDateNo
taxLawCodeNo

Implementation Reference

  • src/index.ts:547-565 (registration)
    Tool registration in the 'tools' array with inputSchema and description stating it's a backward-compatibility wrapper.
    {
      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,
      },
    },
  • Handler dispatch: delegates to searchTaxlawDocuments with fallback docType 'reply'.
    if (name === "search_taxlaw_interpretations") {
      return await searchTaxlawDocuments(input as DocumentSearchArgs, "reply")
    }
  • Actual implementation that search_taxlaw_interpretations delegates to. Handles document search with type codes, deduplication, and pagination.
    async function searchTaxlawDocuments(args: DocumentSearchArgs, fallbackDocType = "reply"): Promise<ToolResponse> {
      validateDateRange(args.fromDate, args.toDate)
    
      const codes = documentCodes(args.docType, fallbackDocType)
      const groups = splitDocumentCodes(codes)
      if (groups.length === 0) {
        throw new TaxlawMcpError("No supported document type selected.", ErrorCodes.INVALID_PARAM)
      }
    
      const settled = await Promise.allSettled(groups.map((group) => searchDocumentGroup(group, args)))
      const results = settled
        .filter((s): s is PromiseFulfilledResult<{ group: "question" | "precedent"; codes: string[]; result: TaxlawSearchData["ASIPDI002PR01"] }> => s.status === "fulfilled")
        .map((s) => s.value)
      const failedGroups = settled
        .map((s, idx) => ({ status: s.status, group: groups[idx], reason: s.status === "rejected" ? s.reason : undefined }))
        .filter((entry) => entry.status === "rejected")
    
      if (results.length === 0) {
        throw failedGroups[0]?.reason ?? new TaxlawMcpError("Taxlaw document search failed.", ErrorCodes.API_ERROR)
      }
    
      const total = results.reduce((sum, entry) => sum + totalCount(entry.result, entry.codes), 0)
      const rawItems = results
        .flatMap((entry) => (entry.result.body || []).map((row) => row.dcm).filter((d): d is TaxlawDcm => !!d))
        .sort((a, b) => documentDateValue(b) - documentDateValue(a))
      const { items: uniqueItems, duplicatesRemoved } = uniqueDocuments(rawItems)
      const items = uniqueItems.slice(0, asPositiveInt(args.display, 20, 50))
    
      if (total === 0 || items.length === 0) {
        const label = codes.map((code) => docLabel(code)).join(", ")
        return notFoundResponse(`국세법령정보시스템 '${args.query || "(전체)"}' ${label} 검색 결과가 없습니다.`, [
          "docType을 all 또는 interpretations/disputes로 넓혀 재검색하세요.",
          "통합검색이 필요하면 search_taxlaw_all을 사용하세요.",
          "본 도구는 코드 01–10(세법해석례·과세전적부심사·이의·심사·심판·판례·헌재)만 직접 지원합니다. 법제처 해석례(actionId=ASIBGE004MR03), 감사원 심사청구(ASIPDM001MR01), 납세자보호위원회 심의사례(ASIPRC019MR02), 평가심의사례(ASIBGH004MR01)는 list_taxlaw_site_menus + call_taxlaw_action으로 조회하세요.",
          "korean-law-mcp의 search_decisions(domain=precedent/interpretation/tax_tribunal/constitutional)도 병행 시도하세요. NTS와 법제처는 인덱싱 범위·본문 검색 강도가 달라 한쪽에만 회수되는 사건이 흔합니다(특히 최신 조세심판원 결정례는 NTS, 일부 대법원·헌재 판결은 법제처가 강세).",
        ])
      }
    
      const title = codes.length === 1 ? docLabel(codes[0]) : codes.map((code) => docLabel(code)).join(", ")
      const lines = [
        `국세법령정보시스템 문서 검색 결과: ${title}`,
        `출처: ${TAXLAW_BASE}/action.do (ASIPDI002PR01)`,
        `검색어: ${args.query || "(전체)"} / 총 ${total.toLocaleString()}건 / page=${asPositiveInt(args.page, 1)}`,
        "주의: 아래 결과는 국세법령정보시스템 응답에 존재한 항목만 표시합니다.",
        "",
      ]
      if (duplicatesRemoved > 0) {
        lines.push(`중복 제거: 같은 문서번호/회신번호/제목으로 보이는 ${duplicatesRemoved.toLocaleString()}건은 표시에서 제외했습니다.`, "")
      }
      if (failedGroups.length > 0) {
        const labels = failedGroups.map((entry) => entry.group.kind === "question" ? "세법해석례/질의회신" : "판례·결정례").join(", ")
        const reasons = failedGroups.map((entry) => entry.reason instanceof Error ? entry.reason.message : String(entry.reason)).join("; ")
        lines.push(`⚠️ 일부 그룹 조회 실패(표시되지 않음): ${labels} — ${reasons}`, "")
      }
      items.forEach((item) => lines.push(formatDocumentSearchItem(item, args.query), ""))
      return textResponse(truncate(lines.join("\n"), 50000))
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must disclose behavioral traits. It reveals that the tool internally uses another search tool, but does not mention side effects, limitations, or differences in behavior. This is minimal transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with two phrases, front-loaded with the core purpose and the internal mechanism. Every part is necessary and no redundant words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 8 parameters, no output schema, and no annotations, the description is severely lacking. It does not explain how to use the parameters, what the search returns, or how it differs from the internal tool. This is insufficient for an agent to use the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% description coverage for its 8 parameters, and the description does not explain any parameter meaning or usage beyond the schema. The description fails to compensate for the lack of parameter documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it searches tax law interpretations and inquiry replies for backward compatibility, and notes it internally uses search_taxlaw_documents. This provides a specific verb and resource, and hints at differentiation from the sibling tool by mentioning internal delegation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'backward compatibility' implies that this tool is for legacy use, but it does not explicitly state when to use it vs. the internal search_taxlaw_documents. The description provides context but lacks explicit usage guidance or alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kim-go-chon/taxlaw-nts-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server