Skip to main content
Glama

get_taxlaw_page_text

Retrieve any HTML or text page from the Korean National Tax Service's law information system by its path, and convert it to plain text for content analysis.

Instructions

국세법령정보시스템 HTML/텍스트 페이지를 같은 사이트 경로로 조회해 텍스트로 변환합니다. 정적 자료(예: 세목별요약정보 /html/U_0101.html) 확인용입니다.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes같은 사이트 내 경로. 예: /bg/USEBGG001M.do, /html/U_0101.html
fullNo

Implementation Reference

  • Interface TaxlawPageTextArgs defines the input schema for the get_taxlaw_page_text tool: path (string, required) and full (boolean, optional).
    interface TaxlawPageTextArgs {
      path?: string
      full?: boolean
    }
  • src/index.ts:534-546 (registration)
    Tool registration in the tools array. Defines name 'get_taxlaw_page_text', description, and inputSchema with required 'path' parameter and optional 'full' parameter.
    {
      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,
      },
    },
  • The getTaxlawPageText function is the actual handler/implementation. It fetches a page from TAXLAW_BASE + path, converts HTML to text, and returns the content. Throws if response is not OK or if extracted text is under 40 characters.
    async function getTaxlawPageText(args: TaxlawPageTextArgs): Promise<ToolResponse> {
      const path = normalizeTaxlawPath(args.path)
      const response = await fetchWithRetry(`${TAXLAW_BASE}${path}`, {
        headers: {
          accept: "text/html,application/xhtml+xml,application/xml;q=0.9,text/plain;q=0.8,*/*;q=0.5",
          "user-agent": userAgent(),
        },
      })
      if (!response.ok) {
        await consume(response)
        throw new TaxlawMcpError(`Taxlaw page fetch failed (${response.status})`, ErrorCodes.API_ERROR)
      }
    
      const contentType = response.headers.get("content-type") || "N/A"
      const raw = await response.text()
      const body = /html|xml/i.test(contentType) || /<[^>]+>/.test(raw) ? htmlToText(raw) : decodeHtml(raw)
      const trimmedLength = body.trim().length
      if (trimmedLength < 40) {
        return notFoundResponse(
          `경로 ${path}의 본문이 비어 있거나 의미 있는 텍스트(${trimmedLength}자)를 포함하지 않습니다.`,
          [
            "동적으로 채워지는 페이지일 가능성이 높습니다. call_taxlaw_action으로 해당 메뉴의 actionId를 호출하세요.",
            "list_taxlaw_site_menus의 note에 정적/동적 여부 안내가 있으니 확인하세요.",
          ],
        )
      }
    
      const lines = [
        "국세법령정보시스템 페이지 텍스트",
        `출처: ${TAXLAW_BASE}${path}`,
        `content-type: ${contentType}`,
        "주의: 아래 텍스트는 HTML 변환 결과이며, 표·이미지·동적 데이터(JS로 채워지는 목록 등)는 누락될 수 있습니다. 본문에 명시되지 않은 내용은 추론·생성하지 마세요.",
        "",
        truncate(body, args.full === true ? 50000 : 15000),
      ]
      return textResponse(lines.join("\n"))
    }
  • src/index.ts:1901-1903 (registration)
    Routing in handleToolCall: when name === 'get_taxlaw_page_text', calls getTaxlawPageText with input as TaxlawPageTextArgs.
    if (name === "get_taxlaw_page_text") {
      return await getTaxlawPageText(input as TaxlawPageTextArgs)
    }
Behavior2/5

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

No annotations provided, so description carries full burden. Only states conversion to text but does not disclose behavior on invalid paths, authentication needs, rate limits, or what the 'full' parameter does. Significant gaps for a mutation-like operation.

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?

Two sentences, front-loaded with purpose. No wasted words, efficient structure.

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?

No output schema or annotations. Description is minimal but covers basic purpose. However, missing explanation of 'full' parameter and behavioral details makes it slightly incomplete for full comprehension.

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

Parameters2/5

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

Schema description coverage is low (50%) with 'full' parameter having no description. Tool description does not explain 'full' or add detail to 'path' beyond existing schema. Fails to compensate for missing schema information.

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?

Description clearly states the tool retrieves an HTML/text page from the National Tax Law Information System and converts it to text, specifying it is for static materials like tax item summary pages. It effectively distinguishes from sibling tools that target specific document types.

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?

Implies usage for checking static materials but does not explicitly compare to sibling tools or provide when-not-to-use guidance. No mention of alternatives or context when to prefer this over specific document retrieval tools.

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