Skip to main content
Glama
scvcoder

korean-privacy-law-mcp

by scvcoder

search_admin_rule

Search administrative rules metadata—PIPC notifications and ministry privacy directives—using keyword queries.

Instructions

행정규칙 검색 (법제처 lawSearch · target=admrul). 고시·훈령·예규 등 행정규칙 메타데이터 조회. 개인정보 도메인의 핵심 — PIPC 공식 고시 8건 + 부처 개인정보보호 훈령 22건이 모두 여기 있음. 다음: get_admin_rule_text(W2.4)로 본문, compare_admin_rule_old_new(W2.4)로 신구법.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes행정규칙(고시·훈령·예규) 키워드. PIPC 고시 8개와 부처별 개인정보보호 훈령 22개가 핵심.
displayNo결과 개수 (기본 100)
pageNo페이지 번호 (기본 1)

Implementation Reference

  • Main tool definition and handler for 'search_admin_rule'. Calls lawSearch.do API with target=admrul, parses XML into AdminRuleItem fields, formats results, and appends suggestions for next steps (get_admin_rule_text).
    export const searchAdminRule: Tool<typeof inputSchema> = {
      name: "search_admin_rule",
      description:
        "행정규칙 검색 (법제처 lawSearch · target=admrul). 고시·훈령·예규 등 행정규칙 메타데이터 조회. " +
        "개인정보 도메인의 핵심 — PIPC 공식 고시 8건 + 부처 개인정보보호 훈령 22건이 모두 여기 있음. " +
        "다음: get_admin_rule_text(W2.4)로 본문, compare_admin_rule_old_new(W2.4)로 신구법.",
      inputSchema,
    
      async handler(args, client) {
        try {
          const xml = await client.fetchApi({
            endpoint: "lawSearch.do",
            target: "admrul",
            extraParams: {
              query: args.query,
              display: String(args.display),
              page: String(args.page),
            },
          });
    
          const result = parseSearchXML<AdminRuleItem>(
            xml,
            "AdmRulSearch",
            "admrul",
            (itemXml) => ({
              행정규칙일련번호: extractTag(itemXml, "행정규칙일련번호"),
              행정규칙ID: extractTag(itemXml, "행정규칙ID"),
              행정규칙명: extractTag(itemXml, "행정규칙명"),
              행정규칙종류: extractTag(itemXml, "행정규칙종류"),
              소관부처명: extractTag(itemXml, "소관부처명"),
              발령일자: extractTag(itemXml, "발령일자"),
              발령번호: extractTag(itemXml, "발령번호"),
              시행일자: extractTag(itemXml, "시행일자"),
              현행연혁구분: extractTag(itemXml, "현행연혁구분"),
              제개정구분명: extractTag(itemXml, "제개정구분명"),
            })
          );
    
          if (result.totalCnt === 0) {
            return notFoundResponse(`행정규칙 검색 결과 없음: "${args.query}"`, [
              `intelligent_law_search(query="${args.query}", search="2") — 행정규칙 조문 본문 검색`,
              `search_law(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.행정규칙ID}, mst=${item.행정규칙일련번호}] ${item.행정규칙명}`;
            if (item.행정규칙종류) text += ` (${item.행정규칙종류})`;
            if (item.현행연혁구분 && item.현행연혁구분 !== "현행")
              text += ` [${item.현행연혁구분}]`;
            text += "\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_admin_rule_text",
                // 본문 조회는 행정규칙일련번호(mst) 필수 (행정규칙ID는 미작동)
                args: { mst: firstItem.행정규칙일련번호 },
                reason: `${firstItem.행정규칙명} 본문 조회`,
              },
            ]);
            text += `\n📎 출처: 행정규칙 — 첫 결과 ${adminRuleUrl(firstItem.행정규칙일련번호)}`;
          }
    
          return { content: [{ type: "text", text }] };
        } catch (err) {
          return formatToolError(err, "search_admin_rule");
        }
      },
    };
  • Input schema using Zod: requires 'query' (string, min 1), optional 'display' (number 1-100, default 100), optional 'page' (number, default 1).
    const inputSchema = z.object({
      query: z
        .string()
        .min(1)
        .describe(
          "행정규칙(고시·훈령·예규) 키워드. PIPC 고시 8개와 부처별 개인정보보호 훈령 22개가 핵심."
        ),
      display: z
        .number()
        .int()
        .min(1)
        .max(100)
        .default(100)
        .describe("결과 개수 (기본 100)"),
      page: z.number().int().min(1).default(1).describe("페이지 번호 (기본 1)"),
    });
  • Type interface AdminRuleItem defining the structure of each search result item with fields like 행정규칙일련번호, 행정규칙ID, 행정규칙명, etc.
    interface AdminRuleItem {
      행정규칙일련번호: string;
      행정규칙ID: string;
      행정규칙명: string;
      행정규칙종류: string;
      소관부처명: string;
      발령일자: string;
      발령번호: string;
      시행일자: string;
      현행연혁구분: string;
      제개정구분명: string;
    }
  • Import of searchAdminRule from search-admin-rule.ts in the registry.
    import { searchAdminRule } from "./primitives/search-admin-rule.js";
  • Registration of searchAdminRule in the ALL_TOOLS array (line 56), which is used to register all tools with the MCP server.
    searchAdminRule,
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It indicates the tool performs a metadata search, which implies a read-only operation, but does not disclose any behavioral traits such as rate limits, authentication requirements, or side effects. The description is basic but not misleading.

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 concise and well-structured, with the main purpose stated first, followed by specific context and a workflow suggestion. Every sentence serves a purpose without unnecessary words.

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?

The description adequately explains the tool's purpose and context within the domain, but it does not describe the output structure or return values. Since there is no output schema, the agent would benefit from knowing what metadata fields are returned, which is missing.

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?

The input schema has 100% description coverage for its three parameters. The main description repeats the same semantic information about the query parameter (PIPC notices and ministerial decrees) found in the schema property description, so it adds no new meaning beyond what the schema already provides. Baseline score of 3 is appropriate.

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 verb '검색' (search) and the resource '행정규칙' (administrative rules), specifying the source '법제처 lawSearch' and the target 'admrul'. It distinguishes from siblings like get_admin_rule_text and compare_admin_rule_old_new by mentioning them as next steps.

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 provides context on when to use the tool, highlighting the core personal information domain with specific counts (8 PIPC notices, 22 ministerial decrees). It also suggests a workflow by pointing to related tools for full text and comparison, though it does not explicitly state when not to use it.

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