Skip to main content
Glama

get_english_law_text

Retrieve the full English text of Korean laws using law ID, series number, or name. Access official translations for legal research or compliance.

Instructions

[영문] 영문 법령 전문.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lawIdNo법령ID (검색 결과에서 획득)
mstNo법령일련번호 (MST)
lawNameNo법령명 (영문 또는 한글)
apiKeyNo법제처 Open API 인증키(OC). 사용자가 제공한 경우 전달

Implementation Reference

  • The actual handler function that executes the get_english_law_text tool logic. It calls the 법제처 (Korea Ministry of Legislation) API to retrieve the full English text of a law, given lawId, mst, or lawName. It parses the JSON response, extracts basic info (name, dates, ministry) and articles (up to 50), then formats and returns the text.
    export async function getEnglishLawText(
      apiClient: LawApiClient,
      args: GetEnglishLawTextInput
    ): Promise<{ content: Array<{ type: string, text: string }>, isError?: boolean }> {
      try {
        if (!args.lawId && !args.mst && !args.lawName) {
          throw new Error("lawId, mst, 또는 lawName 중 하나가 필요합니다.");
        }
    
        const extraParams: Record<string, string> = {};
        if (args.lawId) extraParams.ID = String(args.lawId);
        if (args.mst) extraParams.MST = String(args.mst);
        if (args.lawName) extraParams.LM = String(args.lawName);
    
        const responseText = await apiClient.fetchApi({
          endpoint: "lawService.do",
          target: "elaw",
          type: "JSON",
          extraParams,
          apiKey: args.apiKey,
        });
    
        let data: any;
        try {
          data = JSON.parse(responseText);
        } catch (err) {
          throw new Error("Failed to parse JSON response from API");
        }
    
        if (!data.ElawService) {
          throw new Error("영문법령을 찾을 수 없거나 응답 형식이 올바르지 않습니다.");
        }
    
        const law = data.ElawService;
        const basic = {
          영문법령명: law.영문법령명 || law.법령명_영문,
          한글법령명: law.한글법령명 || law.법령명_한글,
          시행일자: law.시행일자,
          공포일자: law.공포일자,
          법령구분: law.법령구분,
          소관부처: law.소관부처,
        };
    
        let output = `=== ${basic.영문법령명 || "English Law"} ===\n`;
        output += `(${basic.한글법령명 || "N/A"})\n\n`;
    
        output += `📋 Basic Information:\n`;
        output += `  English Name: ${basic.영문법령명 || "N/A"}\n`;
        output += `  Korean Name: ${basic.한글법령명 || "N/A"}\n`;
        output += `  Effective Date: ${basic.시행일자 || "N/A"}\n`;
        output += `  Promulgation Date: ${basic.공포일자 || "N/A"}\n`;
        output += `  Law Type: ${basic.법령구분 || "N/A"}\n`;
        output += `  Competent Ministry: ${basic.소관부처 || "N/A"}\n\n`;
    
        // Extract articles from the response
        const articles = law.조문 || law.조문목록 || [];
        if (Array.isArray(articles) && articles.length > 0) {
          output += `📄 Articles:\n\n`;
          for (const article of articles.slice(0, 50)) { // Limit to first 50 articles
            const articleNo = article.조문번호 || article.조번호 || "";
            const articleTitle = article.조문제목_영문 || article.조문제목 || "";
            const articleContent = article.조문내용_영문 || article.조문내용 || "";
    
            if (articleNo || articleTitle) {
              output += `Article ${articleNo}`;
              if (articleTitle) output += ` ${articleTitle}`;
              output += `\n`;
            }
            if (articleContent) {
              output += `${articleContent}\n\n`;
            }
          }
          if (articles.length > 50) {
            output += `\n... and ${articles.length - 50} more articles\n`;
          }
        } else if (law.법령내용_영문 || law.법령내용) {
          output += `📄 Content:\n${law.법령내용_영문 || law.법령내용}\n`;
        }
    
        return {
          content: [{
            type: "text",
            text: truncateResponse(output)
          }]
        };
      } catch (error) {
        return formatToolError(error, "get_english_law_text");
      }
    }
  • Zod schema defining inputs for get_english_law_text: lawId (법령ID), mst (법령일련번호), lawName (법령명), and optional apiKey. All input fields are optional but at least one must be provided.
    export const getEnglishLawTextSchema = z.object({
      lawId: z.string().optional().describe("법령ID (검색 결과에서 획득)"),
      mst: z.string().optional().describe("법령일련번호 (MST)"),
      lawName: z.string().optional().describe("법령명 (영문 또는 한글)"),
      apiKey: z.string().optional().describe("법제처 Open API 인증키(OC). 사용자가 제공한 경우 전달"),
    });
  • The tool registration entry: name 'get_english_law_text', description '[영문] 영문 법령 전문.', schema linked to getEnglishLawTextSchema, handler linked to getEnglishLawText function.
    {
      name: "get_english_law_text",
      description: "[영문] 영문 법령 전문.",
      schema: getEnglishLawTextSchema,
      handler: getEnglishLawText
    },
  • Import of getEnglishLawText and getEnglishLawTextSchema from the english-law.ts tool file.
    import { searchEnglishLaw, searchEnglishLawSchema, getEnglishLawText, getEnglishLawTextSchema } from "./tools/english-law.js"
  • Tool chain configuration: links search_english_law to get_english_law_text as the detail tool, mapping lawId as the detail parameter.
    search_english_law: {
      detailTool: "get_english_law_text",
      detailParam: "lawId",
      idRegex: /\[([^\]]+)\]/,  // 영문 법령 ID는 숫자가 아닐 수 있음
    },
Behavior1/5

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

No annotations are provided, and the description fails to disclose any behavioral traits such as authentication requirements, rate limits, or output format. For a tool with no behavioral metadata, the description carries full burden but adds no value.

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

Conciseness3/5

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

The description is extremely concise, but at the expense of completeness. It could benefit from a sentence structure that front-loads essential details, but currently it is a fragment.

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

Completeness1/5

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

With no output schema and 4 parameters, the description should explain what the tool returns and how to use it. It only says 'full text' without any additional context on behavior or prerequisites, making it inadequate.

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 coverage is 100% with adequate parameter descriptions (e.g., '법령ID', 'MST', 'lawName', 'apiKey'). The description adds no extra meaning, but the schema itself is informative. Baseline 3 is appropriate.

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 indicates the tool retrieves the full text of English statutes. The verb 'get' and resource 'English law text' are specific, and it is distinguishable from siblings like 'get_law_text' by the explicit mention of English.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

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

No guidance on when to use this tool over alternatives such as 'search_english_law' or 'get_law_text'. The agent is left to infer usage without any contextual cues or exclusionary statements.

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/workbookbulb863/korean-law-alio-mcp'

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