Skip to main content
Glama

call_taxlaw_action

Calls the Korean National Tax Service law information system action endpoint to retrieve tax law data such as interpretations, rulings, or forms using an actionId and referer path.

Instructions

국세법령정보시스템 action.do 원시 호출. list_taxlaw_site_menus의 actionId/defaultParamData 또는 브라우저에서 확인한 actionId를 사용할 수 있습니다.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionIdYesaction.do actionId. 예: ASIPDM001MR01
paramDataNoaction.do paramData JSON 객체. 미입력 시 {}
refererPathYes같은 사이트 내 referer 경로. 예: /pd/USEPDM001M.do
fullNotrue면 JSON 응답을 더 길게 반환

Implementation Reference

  • Input schema definition for the 'call_taxlaw_action' tool. Defines actionId (required), paramData (optional object), refererPath (required string), and full (optional boolean).
    {
      name: "call_taxlaw_action",
      description: "국세법령정보시스템 action.do 원시 호출. list_taxlaw_site_menus의 actionId/defaultParamData 또는 브라우저에서 확인한 actionId를 사용할 수 있습니다.",
      inputSchema: {
        type: "object",
        properties: {
          actionId: { type: "string", description: "action.do actionId. 예: ASIPDM001MR01" },
          paramData: { type: "object", description: "action.do paramData JSON 객체. 미입력 시 {}" },
          refererPath: { type: "string", description: "같은 사이트 내 referer 경로. 예: /pd/USEPDM001M.do" },
          full: { type: "boolean", default: false, description: "true면 JSON 응답을 더 길게 반환" },
        },
        required: ["actionId", "refererPath"],
        additionalProperties: false,
      },
    },
  • Handler function 'callTaxlawAction' that executes the tool logic. Validates actionId (uppercase letters/digits), normalizes refererPath, posts the action via postTaxlawAction, checks for empty payload, and returns the raw JSON response.
    async function callTaxlawAction(args: RawActionArgs): Promise<ToolResponse> {
      const actionId = requireString("actionId", args.actionId)
      if (!/^[A-Z0-9]+$/.test(actionId)) {
        throw new TaxlawMcpError("actionId must contain only uppercase letters and digits", ErrorCodes.INVALID_PARAM)
      }
      const refererPath = normalizeTaxlawPath(args.refererPath)
      const paramData = args.paramData && typeof args.paramData === "object" ? args.paramData : {}
      const data = await postTaxlawAction<unknown>(actionId, paramData, refererPath)
    
      if (isEmptyPayload(data)) {
        return notFoundResponse(
          `국세법령정보시스템 action.do(${actionId}) 응답에 표시 가능한 데이터가 없습니다.`,
          [
            "paramData의 필수 필드(검색어/일자/페이지)를 점검하세요.",
            "list_taxlaw_site_menus로 메뉴별 defaultParamData를 확인 후 재시도하세요.",
          ],
        )
      }
    
      const lines = [
        "국세법령정보시스템 action.do 원시 응답",
        `출처: ${TAXLAW_BASE}/action.do`,
        `referer: ${TAXLAW_BASE}${refererPath}`,
        `actionId: ${actionId}`,
        `paramData: ${JSON.stringify(paramData)}`,
        "주의: 아래 JSON은 NTS action.do의 원시 응답입니다. 응답에 명시되지 않은 사실은 추론·생성하지 말고, 키 이름·값을 그대로 인용해 답변하세요.",
        "",
        stringifyJson(data, args.full === true),
      ]
      return textResponse(lines.join("\n"))
    }
  • src/index.ts:1898-1900 (registration)
    Registration of 'call_taxlaw_action' in the handleToolCall dispatch, mapping the tool name to the callTaxlawAction handler function.
    if (name === "call_taxlaw_action") {
      return await callTaxlawAction(input as RawActionArgs)
    }
  • Helper functions 'postTaxlawAction' and 'postTaxlawActionAttempt' that perform the actual HTTP POST to the taxlaw action.do endpoint with session management, cookie caching, retries, and JSON response parsing.
    async function postTaxlawAction<T>(actionId: string, paramData: unknown, refererPath: string): Promise<T> {
      return postTaxlawActionAttempt<T>(actionId, paramData, refererPath, true)
    }
    
    async function postTaxlawActionAttempt<T>(
      actionId: string,
      paramData: unknown,
      refererPath: string,
      allowRefresh: boolean,
    ): Promise<T> {
      const cookie = await fetchTaxlawSession(refererPath)
      const form = new URLSearchParams()
      form.set("actionId", actionId)
      form.set("paramData", JSON.stringify(paramData))
    
      const response = await fetchWithRetry(`${TAXLAW_BASE}/action.do`, {
        method: "POST",
        headers: {
          accept: "application/json, text/javascript, */*; q=0.01",
          "content-type": "application/x-www-form-urlencoded",
          origin: TAXLAW_BASE,
          referer: `${TAXLAW_BASE}${refererPath}`,
          cookie,
          "user-agent": userAgent(),
        },
        body: form.toString(),
      })
    
      if (!response.ok) {
        await consume(response)
        if (allowRefresh && (response.status === 401 || response.status === 403)) {
          cachedSession = null
          return postTaxlawActionAttempt<T>(actionId, paramData, refererPath, false)
        }
        throw new TaxlawMcpError(`Taxlaw action.do failed (${response.status})`, ErrorCodes.API_ERROR)
      }
    
      let payload: TaxlawActionResponse<T>
      try {
        payload = await response.json() as TaxlawActionResponse<T>
      } catch (error) {
        if (allowRefresh) {
          cachedSession = null
          return postTaxlawActionAttempt<T>(actionId, paramData, refererPath, false)
        }
        throw new TaxlawMcpError(
          `Taxlaw action.do JSON parse failed: ${error instanceof Error ? error.message : String(error)}`,
          ErrorCodes.PARSE_ERROR,
        )
      }
    
      if (payload.status !== "SUCCESS" || !payload.data) {
        throw new TaxlawMcpError(
          `Taxlaw action.do returned ${payload.status}: ${payload.message || "no message"}`,
          ErrorCodes.API_ERROR,
        )
      }
      return payload.data
    }
Behavior2/5

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

No annotations are provided, so the description bears full responsibility for behavioral disclosure. It only labels the call as 'raw' without explaining side effects, required permissions, rate limits, or error handling. This is insufficient for an agent to anticipate tool behavior.

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

Conciseness4/5

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

The description is concise (two sentences), with the main purpose stated upfront. It avoids fluff and each sentence contributes useful contextual information about parameter sourcing.

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 the absence of an output schema and the tool's low-level nature, the description is incomplete. It fails to explain what the response contains, how to interpret results, or any constraints on usage. More context is needed for effective use.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all parameters. The description adds marginal value by hinting at the source of actionId, but does not deepen understanding of parameter semantics beyond what the schema provides.

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 is a raw call to action.do of the tax law system, using a specific verb and resource. It implicitly distinguishes itself from sibling tools, which are more specific (get, search, list), by being a lower-level operation.

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 description provides guidance on where to obtain valid actionId values (from list_taxlaw_site_menus or browser), implying when to use this tool (for arbitrary action.do calls). However, it does not explicitly state when to avoid it or mention 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