Skip to main content
Glama

get_alio_regulation_history

Retrieve the revision history of internal regulations from Korean public institutions, including previous version filenames and current status.

Instructions

[ALIO] 규정 개정 이력(ALIO 공시 첨부본 기준). 이전 개정본 파일명 + 현행본 구분.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
institutionYes기관코드 또는 기관명 일부
regIdNo규정 ID
titleNo제목 부분일치 (regId 대신)

Implementation Reference

  • Main handler function for get_alio_regulation_history tool. Loads the ALIO index, finds an institution by code/name, looks up the regulation manifest entry by regId or title, then formats and returns the revision history including past revisions and the current active regulation.
    export async function getAlioRegulationHistory(
      _api: LawApiClient,
      input: GetAlioRegulationHistoryInput
    ): Promise<ToolResponse> {
      try {
        const idx = await loadIndex()
        const inst = findInstitution(idx, input.institution)
        if (!inst) {
          return {
            content: [{ type: "text", text: `기관을 찾을 수 없습니다: '${input.institution}'` }],
            isError: true,
          }
        }
        const manifest = idx.manifests.get(inst.apbaId)
        if (!manifest) {
          return {
            content: [{ type: "text", text: `manifest 없음: ${inst.apbaId}` }],
            isError: true,
          }
        }
        const entry =
          (input.regId && manifest.regulations.find((r) => r.regId === input.regId)) ||
          (input.title && manifest.regulations.find((r) => r.title.includes(input.title!)))
        if (!entry) {
          return { content: [{ type: "text", text: "규정을 찾을 수 없습니다." }], isError: true }
        }
    
        const lines: string[] = []
        lines.push(`[${inst.apbaId}] ${inst.apbaNa} — ${entry.title}`)
        lines.push(`제·개정일: ${entry.issuedAt || "-"} / 최종 수정일: ${entry.revisedAt || "-"}`)
        lines.push("")
        lines.push("● 개정본 이력 (ALIO 공시 기준, 최신이 아래):")
        for (const rev of entry.revisions) {
          lines.push(`  - ${rev.filename} (fileNo=${rev.fileNo})`)
        }
        lines.push(`  ★ ${entry.primaryFileName} (fileNo=${entry.primaryFileNo}) [현행]`)
        lines.push("")
        lines.push(`원본 페이지: ${entry.sourceDetailUrl}`)
        return { content: [{ type: "text", text: truncateResponse(lines.join("\n")) }] }
      } catch (err) {
        return formatToolError(err, "get_alio_regulation_history")
      }
    }
  • Zod schema for the tool's input validation. Requires 'institution' (code or name) and exactly one of 'regId' or 'title'.
    export const GetAlioRegulationHistorySchema = z.object({
      institution: z.string().describe("기관코드 또는 기관명 일부"),
      regId: z.string().optional().describe("규정 ID"),
      title: z.string().optional().describe("제목 부분일치 (regId 대신)"),
    }).refine((v) => !!(v.regId || v.title), {
      message: "regId 또는 title 중 하나는 필수입니다",
      path: ["regId"],
    })
  • Registration of the get_alio_regulation_history tool in the allTools array. Maps the MCP tool name to its schema and handler function.
    {
      name: "get_alio_regulation_history",
      description: "[ALIO] 규정 개정 이력(ALIO 공시 첨부본 기준). 이전 개정본 파일명 + 현행본 구분.",
      schema: GetAlioRegulationHistorySchema,
      handler: getAlioRegulationHistory
    },
  • Helper imports used by the handler: loadIndex/findInstitution for ALIO index lookup, truncateResponse for response length limiting, and formatToolError for error formatting.
    import { findInstitution, loadIndex } from "../../lib/alio/index-loader.js"
    import { truncateResponse } from "../../lib/schemas.js"
    import { formatToolError } from "../../lib/errors.js"
    import type { ToolResponse } from "../../lib/types.js"
Behavior2/5

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

No annotations are provided, so the description must carry the full burden of behavioral disclosure. It states the tool returns revision history but omits critical details such as read-only nature, authentication requirements, rate limits, or whether it modifies data. The description is insufficient for safe agent invocation.

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 extremely concise at a single sentence fragment, with no wasted words. However, it could be structured more clearly with separate sentences or bullet points. The brevity is acceptable but could improve readability.

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

Completeness2/5

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

As a history retrieval tool, the description lacks essential context such as ordering of results, date range filtering, pagination, or typical use cases. With no output schema, the return format is only vaguely described. The description is incomplete for effective use.

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?

Input schema has 100% coverage with descriptions for all three parameters. The tool's description adds no additional meaning beyond the schema; it does not explain how the parameters interact to retrieve revision history. Baseline score of 3 is appropriate given full schema coverage.

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?

Description clearly states the tool retrieves regulation revision history from ALIO disclosure attachments, specifying what it returns (previous file name and current version). This sufficiently conveys the verb+resource but does not explicitly differentiate from sibling tools like get_alio_regulation or list_alio_regulations.

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 versus alternatives. Given siblings that also deal with regulations, the description fails to provide context for selection, such as prerequisites or typical 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/workbookbulb863/korean-law-alio-mcp'

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