Skip to main content
Glama
scvcoder

korean-privacy-law-mcp

by scvcoder

search_constitutional_decisions

Search Korean Constitutional Court decisions on privacy rights and PIPA interpretation using keywords or case numbers. Access rulings on unconstitutionality, constitutionality, and dismissals.

Instructions

헌법재판소 결정례 검색 (법제처 lawSearch · target=detc). 위헌·합헌·각하 등 헌재 결정 메타. 개인정보 자기결정권은 헌법상 권리(헌재 99헌마513)이며 PIPA 해석 기초. 다음: get_constitutional_decision_text(W2.5)로 결정문 전문.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes헌법재판소 결정례 키워드. 사건명·사건번호 매칭 (예: '개인정보 자기결정권', '주민등록번호').
displayNo결과 개수 (기본 20)
pageNo페이지 번호 (기본 1)

Implementation Reference

  • The main handler function (lines 35-96) for the 'search_constitutional_decisions' tool. It sends a request to the lawSearch.do API with target='detc', parses the XML response (DetcSearch/Detc items), extracts fields (헌재결정례일련번호, 사건번호, 사건명, 종국일자), formats results, appends suggestions, and returns text content. On error, returns a formatted error.
    export const searchConstitutionalDecisions: Tool<typeof inputSchema> = {
      name: "search_constitutional_decisions",
      description:
        "헌법재판소 결정례 검색 (법제처 lawSearch · target=detc). 위헌·합헌·각하 등 헌재 결정 메타. " +
        "개인정보 자기결정권은 헌법상 권리(헌재 99헌마513)이며 PIPA 해석 기초. " +
        "다음: get_constitutional_decision_text(W2.5)로 결정문 전문.",
      inputSchema,
    
      async handler(args, client) {
        try {
          const xml = await client.fetchApi({
            endpoint: "lawSearch.do",
            target: "detc",
            extraParams: {
              query: args.query,
              display: String(args.display),
              page: String(args.page),
            },
          });
    
          const result = parseSearchXML<ConstitutionalItem>(
            xml,
            "DetcSearch",
            // detc endpoint quirk — itemTag 대문자 'Detc'
            "Detc",
            (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`;
            text += "\n";
          }
    
          const firstItem = result.items[0];
          if (firstItem) {
            text = appendSuggestions(text, [
              {
                tool: "get_constitutional_decision_text",
                args: { id: firstItem.헌재결정례일련번호 },
                reason: `${firstItem.사건명.slice(0, 30)}... 전문`,
              },
            ]);
            text += `\n📎 출처: 헌법재판소 결정례 — 첫 결과 ${constitutionalDecisionUrl(firstItem.헌재결정례일련번호)}`;
          }
    
          return { content: [{ type: "text", text }] };
        } catch (err) {
          return formatToolError(err, "search_constitutional_decisions");
        }
      },
    };
  • Zod input schema: 'query' (string, min 1), 'display' (int 1-100, default 20), 'page' (int 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)"),
    });
  • Import of searchConstitutionalDecisions from the implementation file (line 14) and its inclusion in the ALL_TOOLS array (line 58), registering it as an available MCP tool.
    import { searchConstitutionalDecisions } from "./primitives/search-constitutional-decisions.js";
    import { searchAdminAppeals } from "./primitives/search-admin-appeals.js";
    import { searchInterpretations } from "./primitives/search-interpretations.js";
    import { searchEnglishLaw } from "./primitives/search-english-law.js";
    import { getAdminRuleText } from "./primitives/get-admin-rule-text.js";
    import { getPipcDecisionText } from "./primitives/get-pipc-decision-text.js";
    import { getConstitutionalDecisionText } from "./primitives/get-constitutional-decision-text.js";
    import { getAdminAppealText } from "./primitives/get-admin-appeal-text.js";
    import { getInterpretationText } from "./primitives/get-interpretation-text.js";
    import { getEnglishLawText } from "./primitives/get-english-law-text.js";
    import { compareAdminRuleOldNew } from "./primitives/compare-admin-rule-old-new.js";
    import { getLawHistory } from "./primitives/get-law-history.js";
    import { getHistoricalLaw } from "./primitives/get-historical-law.js";
    import { compareOldNew } from "./primitives/compare-old-new.js";
    import { getThreeTier } from "./primitives/get-three-tier.js";
    import { getArticleChangeHistory } from "./primitives/get-article-change-history.js";
    import { getDelegatedLaws } from "./primitives/get-delegated-laws.js";
    import { getLawSystemTree } from "./primitives/get-law-system-tree.js";
    import { getIntelligentRelatedLaws } from "./primitives/get-intelligent-related-laws.js";
    import { compareArticles } from "./primitives/compare-articles.js";
    import { getLegalTerm } from "./primitives/get-legal-term.js";
    import { getTermArticles } from "./primitives/get-term-articles.js";
    import { getLawAbbreviations } from "./primitives/get-law-abbreviations.js";
    import { getLawTree } from "./primitives/get-law-tree.js";
    // W3 — Layer C corpus
    import { searchPrivacyCorpus } from "./corpus/search-privacy-corpus.js";
    import { searchPrivacyCases } from "./corpus/search-privacy-cases.js";
    import { searchPrivacyGuides } from "./corpus/search-privacy-guides.js";
    // W3 — Layer B+ hints (PIPC 공식 출처 인덱스화)
    import { getSectoralRelatedLaws } from "./hints/get-sectoral-related-laws.js";
    import { getPipcCuratedCorpus } from "./hints/get-pipc-curated-corpus.js";
    // W4 — Validator (4계층 환각 검증)
    import { verifyPipaCitation } from "./validator/verify-pipa-citation.js";
    
    export const ALL_TOOLS: Tool[] = [
      // W1.5
      searchLaw,
      getLawText,
      intelligentLawSearch,
      getRelatedLaws,
      getAnnexes,
      // W2 — search primitives (admin rule + decisions + interpretations + english)
      searchAdminRule,
      searchPipcDecisions,
      searchConstitutionalDecisions,
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 discloses that the tool returns metadata ('헌재 결정 메타') and references a specific case, but does not mention whether it is read-only, authentication requirements, rate limits, or the exact structure of the response. This is adequate but lacks important behavioral details.

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 highly concise: two sentences in Korean that efficiently convey purpose, source, metadata type, a key case reference, and a pointer to the next tool. Every element earns its place with no redundancy.

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

Completeness4/5

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

Given the tool's complexity (search with 3 params, no output schema, no annotations), the description covers the core intent and provides a use case example. It lacks details on output format and behavioral constraints, but the pointer to the sibling tool for full text and the parameter examples make it fairly complete for a metadata search tool.

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% with descriptions for all three parameters. The description adds value by providing examples for the query parameter ('사건명·사건번호 매칭 (예: '개인정보 자기결정권', '주민등록번호')'), which goes beyond the schema's generic description. For display and page, it does not add extra meaning beyond defaults, but the overall contribution is positive.

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 specifies searching constitutional court decisions (헌법재판소 결정례 검색) with specific metadata like unconstitutionality, constitutionality, and dismissal. It references a source (법제처 lawSearch · target=detc) and a key case, and distinguishes itself from the sibling tool get_constitutional_decision_text by explicitly pointing to it for 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 Guidelines4/5

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

The description provides clear context by stating it returns metadata and directs to get_constitutional_decision_text for the full decision text. However, it does not explicitly state when not to use this tool or list alternatives for other search scenarios.

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