Skip to main content
Glama
scvcoder

korean-privacy-law-mcp

by scvcoder

search_interpretations

Search official interpretations of Korean privacy law. Find authoritative rulings on PIPA and its enforcement decree when article meanings are unclear.

Instructions

법령해석례 검색 (법제처 lawSearch · target=expc). 법제처·부처가 회신한 공식 해석 결정 메타. 조문 해석에 의문 있을 때 PIPA·시행령 적용 사례를 회신 기록으로 확인. 다음: get_interpretation_text(W2.6)로 해석 본문.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes법령해석례 키워드. 안건명·안건번호·질의기관·회신기관 매칭.
displayNo결과 개수 (기본 20)
pageNo페이지 번호 (기본 1)

Implementation Reference

  • The main handler function that executes the search_interpretations tool logic. Calls lawSearch.do API with target=expc, parses XML results into InterpretationItem objects, formats the text response, and suggests get_interpretation_text as the next step.
      async handler(args, client) {
        try {
          const xml = await client.fetchApi({
            endpoint: "lawSearch.do",
            target: "expc",
            extraParams: {
              query: args.query,
              display: String(args.display),
              page: String(args.page),
            },
          });
    
          const result = parseSearchXML<InterpretationItem>(
            xml,
            "Expc",
            "expc",
            (itemXml) => ({
              법령해석례일련번호: extractTag(itemXml, "법령해석례일련번호"),
              안건명: extractTag(itemXml, "안건명"),
              안건번호: extractTag(itemXml, "안건번호"),
              질의기관명: extractTag(itemXml, "질의기관명"),
              회신기관명: extractTag(itemXml, "회신기관명"),
              회신일자: extractTag(itemXml, "회신일자"),
            })
          );
    
          if (result.totalCnt === 0) {
            return notFoundResponse(`법령해석례 검색 결과 없음: "${args.query}"`, [
              `search_pipc_decisions(query="${args.query}") — PIPC 의결 시도`,
              `intelligent_law_search(query="${args.query}") — 법령 조문 검색`,
            ]);
          }
    
          let text = `법령해석례 — "${args.query}"\n`;
          text += `총 ${result.totalCnt}건 중 ${result.items.length}건 표시 (페이지 ${result.page})\n\n`;
    
          for (const item of result.items) {
            text += `[id=${item.법령해석례일련번호}] ${item.안건명}\n`;
            if (item.안건번호) text += `  안건번호: ${item.안건번호}\n`;
            if (item.질의기관명) text += `  질의: ${item.질의기관명}\n`;
            if (item.회신기관명) text += `  회신: ${item.회신기관명}\n`;
            if (item.회신일자) text += `  회신일: ${item.회신일자}\n`;
            text += "\n";
          }
    
          const firstItem = result.items[0];
          if (firstItem) {
            text = appendSuggestions(text, [
              {
                tool: "get_interpretation_text",
                args: { id: firstItem.법령해석례일련번호 },
                reason: `${firstItem.안건명.slice(0, 30)}... 해석 본문`,
              },
            ]);
            text += `\n📎 출처: 법령해석례 — 첫 결과 ${interpretationUrl(firstItem.법령해석례일련번호)}`;
          }
    
          return { content: [{ type: "text", text }] };
        } catch (err) {
          return formatToolError(err, "search_interpretations");
        }
      },
    };
  • Zod input schema for search_interpretations: requires query (string min 1), optional display (1-100, default 20), and optional page (min 1, default 1).
    const inputSchema = z.object({
      query: z
        .string()
        .min(1)
        .describe("법령해석례 키워드. 안건명·안건번호·질의기관·회신기관 매칭."),
      display: z.number().int().min(1).max(100).default(20).describe("결과 개수 (기본 20)"),
      page: z.number().int().min(1).default(1).describe("페이지 번호 (기본 1)"),
    });
  • The full Tool object export including name 'search_interpretations', description, inputSchema, and the async handler function.
    export const searchInterpretations: Tool<typeof inputSchema> = {
      name: "search_interpretations",
      description:
        "법령해석례 검색 (법제처 lawSearch · target=expc). 법제처·부처가 회신한 공식 해석 결정 메타. " +
        "조문 해석에 의문 있을 때 PIPA·시행령 적용 사례를 회신 기록으로 확인. " +
        "다음: get_interpretation_text(W2.6)로 해석 본문.",
      inputSchema,
    
      async handler(args, client) {
        try {
          const xml = await client.fetchApi({
            endpoint: "lawSearch.do",
            target: "expc",
            extraParams: {
              query: args.query,
              display: String(args.display),
              page: String(args.page),
            },
          });
    
          const result = parseSearchXML<InterpretationItem>(
            xml,
            "Expc",
            "expc",
            (itemXml) => ({
              법령해석례일련번호: extractTag(itemXml, "법령해석례일련번호"),
              안건명: extractTag(itemXml, "안건명"),
              안건번호: extractTag(itemXml, "안건번호"),
              질의기관명: extractTag(itemXml, "질의기관명"),
              회신기관명: extractTag(itemXml, "회신기관명"),
              회신일자: extractTag(itemXml, "회신일자"),
            })
          );
    
          if (result.totalCnt === 0) {
            return notFoundResponse(`법령해석례 검색 결과 없음: "${args.query}"`, [
              `search_pipc_decisions(query="${args.query}") — PIPC 의결 시도`,
              `intelligent_law_search(query="${args.query}") — 법령 조문 검색`,
            ]);
          }
    
          let text = `법령해석례 — "${args.query}"\n`;
          text += `총 ${result.totalCnt}건 중 ${result.items.length}건 표시 (페이지 ${result.page})\n\n`;
    
          for (const item of result.items) {
            text += `[id=${item.법령해석례일련번호}] ${item.안건명}\n`;
            if (item.안건번호) text += `  안건번호: ${item.안건번호}\n`;
            if (item.질의기관명) text += `  질의: ${item.질의기관명}\n`;
            if (item.회신기관명) text += `  회신: ${item.회신기관명}\n`;
            if (item.회신일자) text += `  회신일: ${item.회신일자}\n`;
            text += "\n";
          }
    
          const firstItem = result.items[0];
          if (firstItem) {
            text = appendSuggestions(text, [
              {
                tool: "get_interpretation_text",
                args: { id: firstItem.법령해석례일련번호 },
                reason: `${firstItem.안건명.slice(0, 30)}... 해석 본문`,
              },
            ]);
            text += `\n📎 출처: 법령해석례 — 첫 결과 ${interpretationUrl(firstItem.법령해석례일련번호)}`;
          }
    
          return { content: [{ type: "text", text }] };
        } catch (err) {
          return formatToolError(err, "search_interpretations");
        }
      },
    };
  • Import of searchInterpretations from search-interpretations.ts into the central tool registry.
    import { searchInterpretations } from "./primitives/search-interpretations.js";
  • Registration of searchInterpretations in the tools array, making it available as an MCP tool.
    searchInterpretations,
Behavior4/5

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

With no annotations, the description discloses that the tool returns metadata and that the full text is elsewhere. It does not mention rate limits or authentication, but the search behavior is clearly explained.

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 concise sentences with a forward-reference to the next tool. Every part adds value, no waste.

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

Completeness5/5

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

Given the tool's simplicity (search, no output schema), the description provides sufficient context about purpose, usage, and return type, making it complete for an AI agent.

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 coverage is 100%, but the description adds value by explaining that the query matches against title, number, inquiry institution, and reply institution, which is not fully captured in the schema properties.

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 searches for statutory interpretations (법령해석례) and specifies it returns metadata of official decisions from the Ministry and departments. It distinguishes itself from the sibling get_interpretation_text which returns full 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 advises using this tool when there is doubt about article interpretation, and points to get_interpretation_text for the full text, providing clear guidance on when and what to use next.

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/scvcoder/korean-privacy-law-mcp'

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