Skip to main content
Glama

get_taxlaw_basic_ruling_text

Retrieve the full text of a basic tax ruling from the Korean National Tax Service database. Uses a law ID from a previous list result; optionally filter by year or search within the text.

Instructions

국세법령정보시스템 기본통칙 본문 조회. list_taxlaw_basic_ruling_laws 결과의 lawId 사용.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lawIdYes기본통칙 법령 ID(ntstBscId)
yearNo연도. 미입력 시 최신 연도
queryNo통칙 제목/본문 내 필터
displayNo
fullNo

Implementation Reference

  • Input schema (BasicRulingTextArgs) for get_taxlaw_basic_ruling_text with lawId, year, query, display, full parameters.
    interface BasicRulingTextArgs {
      lawId?: string
      year?: string
      query?: string
      display?: number
      full?: boolean
    }
  • src/index.ts:591-606 (registration)
    Tool registration in the tools array with name 'get_taxlaw_basic_ruling_text', description, and inputSchema definition.
    {
      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,
      },
    },
  • The async function getTaxlawBasicRulingText that executes the tool logic: fetches basic ruling text from the NTS API using actionId ASISTD001MR02, filters by query, and formats results.
    async function getTaxlawBasicRulingText(args: BasicRulingTextArgs): Promise<ToolResponse> {
      const lawId = requireString("lawId", args.lawId)
      validateYear(args.year)
      const year = args.year || await getLatestBasicRulingYear(lawId)
      const display = asPositiveInt(args.display, 30, 200)
      const data = await postTaxlawAction<BasicRulingData>(
        "ASISTD001MR02",
        { ntstBscId: lawId, rgtYr: year },
        `/st/USESTD002M.do?ntstBscId=${encodeURIComponent(lawId)}`,
      )
    
      const query = cleanText(args.query).toLowerCase()
      const allItems = [
        ...(data.ASISTD001MR02?.bscExrDVOList || []),
        ...(data.ASISTD001MR02?.bscExrDVOArList || []),
      ]
      const textItems = allItems
        .filter((item) => item.lawClCd === "5" || cleanText(htmlToText(item.ntstTextCntn || "")))
        .filter((item) => {
          if (!query) return true
          return `${cleanText(item.ntstTextNm)} ${cleanText(htmlToText(item.ntstTextCntn || ""))}`.toLowerCase().includes(query)
        })
    
      if (textItems.length === 0) {
        return notFoundResponse(`기본통칙 ${lawId}/${year}에서 '${args.query || "(전체)"}' 항목을 찾을 수 없습니다.`, [
          "list_taxlaw_basic_ruling_laws로 lawId를 확인하세요.",
          "year를 비우면 최신 연도로 조회합니다.",
        ])
      }
    
      const shown = args.full ? textItems : textItems.slice(0, display)
      const lines = [
        `국세법령정보시스템 기본통칙 본문`,
        `출처: ${TAXLAW_BASE}/st/USESTD002M.do?ntstBscId=${encodeURIComponent(lawId)}`,
        `lawId: ${lawId} / year: ${year} / 검색어: ${args.query || "(전체)"}`,
        `총 ${textItems.length.toLocaleString()}개 중 ${shown.length.toLocaleString()}개 표시`,
        "",
      ]
    
      for (const item of shown) {
        const body = htmlToText(item.ntstTextCntn || "")
        lines.push(`[${item.ntstExrBaseSn || "N/A"}] ${cleanText(item.ntstTextNm) || "N/A"}`)
        if (body) lines.push(truncate(body, args.full ? 3000 : 1200))
        lines.push("")
      }
      if (!args.full && textItems.length > shown.length) {
        lines.push(`더 많은 항목이 있습니다. display를 늘리거나 full=true로 재조회하세요.`)
      }
      return textResponse(truncate(lines.join("\n"), args.full ? 50000 : 30000))
    }
  • Helper function getLatestBasicRulingYear that fetches the latest year for a given lawId using actionId ASISTD001MR03.
    async function getLatestBasicRulingYear(lawId: string): Promise<string> {
      const data = await postTaxlawAction<BasicRulingData>(
        "ASISTD001MR03",
        { ntstBscId: lawId },
        `/st/USESTD002M.do?ntstBscId=${encodeURIComponent(lawId)}`,
      )
      const year = data.ASISTD001MR03?.bscExrDVOList?.map((item) => item.rgtYr).find(Boolean)
      if (!year) throw new TaxlawMcpError(`기본통칙 연도 목록을 찾을 수 없습니다: ${lawId}`, ErrorCodes.NOT_FOUND)
      return year
    }
  • src/index.ts:1913-1915 (registration)
    Dispatcher call in handleToolCall that routes 'get_taxlaw_basic_ruling_text' to getTaxlawBasicRulingText.
    if (name === "get_taxlaw_basic_ruling_text") {
      return await getTaxlawBasicRulingText(input as BasicRulingTextArgs)
    }
Behavior3/5

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

No annotations are provided, so the description carries the burden. It implies a read operation but does not disclose idempotency, error behavior, or rate limits, though it mentions the dependency on a sibling tool.

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 a single concise sentence with two clauses: the resource and the usage direction. No unnecessary words, effectively front-loaded.

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

Completeness3/5

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

For a 5-parameter tool with no output schema and no annotations, the description is moderately complete. It explains the key parameter but lacks details on return values, error cases, and the effect of the 'full' boolean.

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

Parameters4/5

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

Schema descriptions cover 60% of parameters, but the description adds value by explaining that lawId originates from list results, which is not in the schema. Other parameter descriptions are present in the schema, so baseline is met and improved.

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 it retrieves basic ruling text from the National Tax Laws Information System and specifies the required lawId from a sibling tool, distinguishing it from other get_ and search_ tools.

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

Usage Guidelines4/5

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

The description instructs to use the lawId from list_taxlaw_basic_ruling_laws results, providing clear when-to-use guidance. However, it does not state when not to use or list alternatives, missing explicit exclusions.

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