Skip to main content
Glama

get_taxlaw_interpretation_text

Retrieve detailed text of Korean tax law interpretations and official rulings using a unique ID. Includes the full content of questions and answers.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
fullNo

Implementation Reference

  • src/index.ts:566-578 (registration)
    Tool definition registration for 'get_taxlaw_interpretation_text' in the tools array with inputSchema (name, description, inputSchema for id and full).
    {
      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,
      },
    },
  • Handler in handleToolCall that delegates to getTaxlawDocumentText with docType defaulting to 'reply'.
    if (name === "get_taxlaw_interpretation_text") {
      return await getTaxlawDocumentText({ ...input, docType: input.docType || "reply" } as DocumentDetailArgs)
    }
  • The actual implementation function getTaxlawDocumentText which fetches document detail via postTaxlawAction and formats the result.
    async function getTaxlawDocumentText(args: DocumentDetailArgs): Promise<ToolResponse> {
      const rawId = requireString("id", args.id)
      const id = normalizeDetailId(rawId)
      const knownCode = docCodeFromType(args.docType)
      const attempts = knownCode
        ? [refererForDoc(knownCode, id)]
        : [`/qt/USEQTA002P.do?ntstDcmId=${encodeURIComponent(id)}`, `/pd/USEPDA002P.do?ntstDcmId=${encodeURIComponent(id)}`]
    
      let lastError: unknown
      for (const referer of attempts) {
        try {
          const data = await postTaxlawAction<TaxlawDetailData>(
            "ASIQTB002PR01",
            { dcmDVO: { ntstDcmId: id } },
            referer,
          )
          const detail = data.ASIQTB002PR01
          const dcm = detail.dcmDVO
          if (!dcm) continue
          return textResponse(formatDocumentDetail(id, dcm, detail, args.full === true, referer))
        } catch (error) {
          lastError = error
        }
      }
    
      if (lastError instanceof TaxlawMcpError) {
        if (attempts.length === 1) throw lastError
        if (lastError.code !== ErrorCodes.NOT_FOUND && lastError.code !== ErrorCodes.PARSE_ERROR) {
          throw lastError
        }
      }
      return notFoundResponse(`국세법령정보시스템 문서 상세를 찾을 수 없습니다: ${rawId}`, [
        "search_taxlaw_documents로 DOC_ID를 다시 확인하세요.",
        "docType을 알고 있으면 함께 입력하세요.",
      ])
    }
  • formatDocumentDetail helper that formats the detailed document output with metadata, body text, and related precedents.
    function formatDocumentDetail(id: string, dcm: TaxlawDcm, detail: TaxlawDetailData["ASIQTB002PR01"], full: boolean, referer: string): string {
      const relatedLaws = (detail.dcmRltnStttList || [])
        .map((item) => cleanText(item.ntstTextNm))
        .filter(Boolean)
        .join(", ")
      const referencePrecedents = (detail.dcmRfrnPrtsList || [])
        .map((item) => [cleanText(item.ntstDcmDscmCntn), cleanText(item.ntstDcmTtl)].filter(Boolean).join(" "))
        .filter(Boolean)
      const quotedPrecedents = (detail.dcmQutPrtsList || [])
        .map((item) => [cleanText(item.ntstDcmDscmCntn), cleanText(item.ntstDcmTtl)].filter(Boolean).join(" "))
        .filter(Boolean)
      const bodyText = detailTextFromHtmlList(detail.dcmHwpEditorDVOList)
      const code = dcm.ntstDcmClCd || dcm.NTST_DCM_CL_CD
      const type = dcm.ntstDcmClNm || dcm.NTST_DCM_CL_NM || docLabel(code)
      const title = cleanText(dcm.ntstDcmTtl || dcm.TTL)
    
      const lines = [
        `=== ${title || "(제목 없음)"} ===`,
        "",
        "기본 정보:",
        `  ID: ${dcm.ntstDcmId || id}`,
        `  구분: ${type}`,
        `  세목코드: ${dcm.ntstTlawClCd || "N/A"}`,
        `  문서번호: ${cleanText(dcm.ntstDcmDscmCntn || dcm.NTST_DCM_DSCM_CNTN) || "N/A"}`,
        `  회신번호: ${cleanText(dcm.ntstDcmRplyCntn || dcm.NTST_DCM_RPLY_CNTN) || "N/A"}`,
        `  결정: ${cleanText(dcm.ntstDcmDcsClNm || dcm.NTST_DCM_DCS_CL_NM) || "N/A"}`,
        `  생산일자: ${normalizeDate(dcm.ntstDcmRgtDt || dcm.DCM_RGT_DTM)} / 등록일자: ${normalizeDate(dcm.frsRgtDtm || dcm.FRS_RGT_DTM)}`,
        `  출처: ${TAXLAW_BASE}${referer}`,
      ]
      if (relatedLaws) lines.push(`  관련법령: ${relatedLaws}`)
      lines.push("")
    
      const gist = cleanText(dcm.ntstDcmGistCntn || dcm.GIST_CNTN)
      const answer = cleanText(dcm.ntstDcmCntn || dcm.CNTN)
      if (gist) lines.push("요지:", gist, "")
      if (answer) lines.push("본문/회신/결정내용:", answer, "")
      if (bodyText) lines.push(full ? "원문 변환 텍스트:" : "원문 요약 텍스트:", compactBodyText(bodyText, full), "")
      if (referencePrecedents.length > 0) {
        lines.push("참조 판례:", ...referencePrecedents.slice(0, 20).map((item) => `  - ${item}`), "")
      }
      if (quotedPrecedents.length > 0) {
        lines.push("인용 판례:", ...quotedPrecedents.slice(0, 20).map((item) => `  - ${item}`), "")
      }
    
      return truncate(lines.join("\n"), full ? 50000 : 30000)
    }
  • normalizeDetailId helper used to normalize the document ID (strip '001_' prefix).
    function normalizeDetailId(id: string): string {
      const trimmed = id.trim()
      const prefixed = trimmed.match(/^001_(\d+)$/)
      return prefixed ? prefixed[1] : trimmed
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions internal use of get_taxlaw_document_text, which implies a read operation, but does not disclose any other behavioral traits like safety, needed permissions, or idempotency. The description is too terse to be transparent.

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

Conciseness3/5

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

The description is very short (one sentence), which is concise but lacks essential details. It front-loads purpose and usage, but the brevity comes at the cost of missing parameter and behavior descriptions. It is not optimally structured for completeness given the tool's 0% schema coverage.

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

Completeness2/5

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

Given no output schema, 0% schema coverage, and two parameters, the description is insufficient. It provides purpose and usage guidelines but omits parameter semantics, return value description, and detailed behavior. The tool is not fully described for an agent to use correctly without further context.

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?

Schema description coverage is 0%, yet the description does not mention the parameters (id, full) at all. It fails to explain what values are expected for id or the effect of the full flag, leaving the agent with no guidance beyond the schema.

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

Purpose5/5

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

The description clearly states the tool retrieves detailed tax law interpretation cases/inquiry responses ('세법해석례/질의회신 상세 조회'), and explicitly marks itself as backward-compatible ('하위호환용'), distinguishing it from siblings like get_taxlaw_document_text.

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

Usage Guidelines5/5

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

The description explicitly states this tool is for backward compatibility and internally uses get_taxlaw_document_text, indicating to agents that newer code should prefer the latter. This provides clear when-to-use guidance and exclusion of 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