Skip to main content
Glama
scvcoder

korean-privacy-law-mcp

by scvcoder

get_constitutional_decision_text

Retrieve full text of Korean constitutional court decisions, including case name, case number, summary, and holdings, to track constitutional grounds for PIPA interpretation.

Instructions

헌재 결정문 전문 (법제처 lawService · target=detc). 사건명·사건번호·결정요지·판시사항·전문 추출. PIPA 해석의 헌법적 근거(자기결정권 등) 추적. 긴 전문은 자동 축약. 다음: search_constitutional_decisions로 유사 사건, intelligent_law_search로 인용 조문 검색.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes헌재결정례일련번호 (search_constitutional_decisions 결과의 [id=N])

Implementation Reference

  • The handler function that fetches and returns the full text of a Korean Constitutional Court decision. It calls the lawService API, parses the JSON response, extracts fields like 사건명, 사건번호, 판시사항, 결정요지, 전문, and formats them into a text response with suggestions.
      async handler(args, client) {
        try {
          const jsonText = await client.fetchApi({
            endpoint: "lawService.do",
            target: "detc",
            type: "JSON",
            extraParams: { ID: args.id },
          });
    
          let parsed: { DetcService?: ConstitutionalDecisionData; Law?: string };
          try {
            parsed = JSON.parse(jsonText);
          } catch {
            return notFoundResponse(`헌재 결정문 응답 파싱 실패 (id=${args.id})`, [
              `search_constitutional_decisions(query="...") — 유효한 id 확인`,
            ]);
          }
    
          if (typeof parsed.Law === "string") {
            return notFoundResponse(`헌재 결정문 없음: ${parsed.Law}`, [
              `search_constitutional_decisions(query="...") — 유효한 id 확인`,
            ]);
          }
    
          const decision = parsed.DetcService;
          if (!decision) {
            return notFoundResponse(`헌재 결정문 데이터 없음 (id=${args.id})`, [
              `search_constitutional_decisions(query="...") — 유효한 id 확인`,
            ]);
          }
    
          const title = decision.사건명 ?? "(사건명 없음)";
    
          let text = `=== ${title} ===\n`;
          if (decision.사건번호) text += `사건번호: ${decision.사건번호}\n`;
          if (decision.사건종류명) text += `사건종류: ${decision.사건종류명}\n`;
          if (decision.종국일자) text += `종국일자: ${decision.종국일자}\n`;
          if (decision.헌재결정례일련번호)
            text += `결정례ID: ${decision.헌재결정례일련번호}\n`;
    
          // 핵심 본문 — 우선순위 (판시사항 → 결정요지 → 전문)
          text += formatField("판시사항", decision.판시사항);
          text += formatField("결정요지", decision.결정요지);
          text += formatField("심판대상조문", decision.심판대상조문);
          text += formatField("참조조문", decision.참조조문);
          text += formatField("참조판례", decision.참조판례);
          text += formatField("전문", decision.전문);
    
          text = appendSuggestions(text, [
            {
              tool: "search_constitutional_decisions",
              args: { query: title.slice(0, 20) },
              reason: "유사 헌재 결정 검색",
            },
          ]);
          text += `\n📎 출처: 헌법재판소 결정례 (id=${args.id}) — ${constitutionalDecisionUrl(args.id)}`;
    
          return { content: [{ type: "text", text }] };
        } catch (err) {
          return formatToolError(err, "get_constitutional_decision_text");
        }
      },
    };
  • Input schema for the tool: requires an 'id' string (헌재결정례일련번호) from search_constitutional_decisions results.
    const inputSchema = z.object({
      id: z
        .string()
        .min(1)
        .describe(
          "헌재결정례일련번호 (search_constitutional_decisions 결과의 [id=N])"
        ),
    });
  • Import of getConstitutionalDecisionText from its primitive module, and its inclusion in the ALL_TOOLS array (line 65) for registration.
    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,
      searchAdminAppeals,
      searchInterpretations,
      searchEnglishLaw,
      // W2 — get text primitives
      getAdminRuleText,
      getPipcDecisionText,
      getConstitutionalDecisionText,
  • formatField helper function used to format each field section with HTML stripping and optional compaction for long text.
    function formatField(label: string, value: string | undefined): string {
      if (!value) return "";
      const cleaned = stripHtmlTags(value);
      if (!cleaned) return "";
      const compacted =
        cleaned.length > FIELD_COMPACT_THRESHOLD
          ? compactBody(cleaned, {
              headLimit: 1500,
              tailLimit: 800,
              minLength: FIELD_COMPACT_THRESHOLD,
            })
          : cleaned;
      return `\n[${label}]\n${compacted}\n`;
    }
  • ConstitutionalDecisionData interface defining the shape of the API response fields.
    interface ConstitutionalDecisionData {
      헌재결정례일련번호?: string;
      사건명?: string;
      사건번호?: string;
      사건종류명?: string;
      사건종류코드?: string;
      종국일자?: string;
      재판부구분코드?: string;
      판시사항?: string;
      결정요지?: string;
      심판대상조문?: string;
      참조조문?: string;
      참조판례?: string;
      전문?: string;
    }
Behavior4/5

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

Description discloses that long texts are automatically abbreviated and lists extracted fields. No annotations exist, so description carries full burden, and it provides useful behavioral context beyond the parameter schema.

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?

Description is concise with three sentences and a follow-up clause. It is front-loaded with the main function and efficiently covers extraction details and abbreviation behavior. Slight room for improvement by separating guidelines more clearly.

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?

For a simple one-parameter tool with no output schema, the description covers core functionality, special behavior (abbreviation), and related tools. An agent can determine when to invoke this tool without ambiguity.

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 single parameter 'id' is well-described in the input schema (serial number from search results). The description does not add further meaning beyond what the schema provides, so 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?

Description clearly states it retrieves full text of constitutional court decisions and extracts key elements like case name and holdings. It distinguishes from sibling tools like search_constitutional_decisions and intelligent_law_search.

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?

Description provides explicit post-use suggestions for related sibling tools, guiding when to use each. It lacks a direct when-not-to-use statement but the context is clear.

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