Skip to main content
Glama

search_admin_appeals

Search Korean administrative appeal precedents by keyword, with sort options for date, case number, or ruling name, and pagination control.

Instructions

[행심] 행정심판례 검색.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNo검색 키워드 (예: '취소처분', '영업정지', '과태료')
displayYes페이지당 결과 개수 (기본값: 20, 최대: 100)
pageYes페이지 번호 (기본값: 1)
sortNo정렬 옵션: lasc/ldes (재결례명순), dasc/ddes (의결일자순), nasc/ndes (사건번호순)
apiKeyNo법제처 Open API 인증키(OC). 사용자가 제공한 경우 전달

Implementation Reference

  • Main handler function for the search_admin_appeals tool. Calls the LawApiClient to search administrative appeal decisions, parses the XML response, formats results, and handles errors.
    export async function searchAdminAppeals(
      apiClient: LawApiClient,
      args: SearchAdminAppealsInput
    ): Promise<{ content: Array<{ type: string, text: string }>, isError?: boolean }> {
      try {
        const extraParams: Record<string, string> = {
          display: (args.display || 20).toString(),
          page: (args.page || 1).toString(),
        };
        if (args.query) extraParams.query = args.query;
        if (args.sort) extraParams.sort = args.sort;
    
        const xmlText = await apiClient.fetchApi({
          endpoint: "lawSearch.do",
          target: "decc",
          extraParams,
          apiKey: args.apiKey,
        });
    
        // 공통 파서 사용
        const result = parseAdminAppealXMLShared(xmlText);
        const totalCount = result.totalCnt;
        const currentPage = result.page;
        const appeals = result.items;
    
        if (totalCount === 0) {
          let errorMsg = "검색 결과가 없습니다.";
          errorMsg += `\n\n💡 개선 방법:`;
          errorMsg += `\n   1. 단순 키워드 사용:`;
          if (args.query) {
            const words = args.query.split(/\s+/);
            if (words.length > 1) {
              errorMsg += `\n      search_admin_appeals(query="${words[0]}")`;
            }
          }
          errorMsg += `\n\n   2. 일반 판례 검색:`;
          errorMsg += `\n      search_precedents(query="${args.query || '관련 키워드'}")`;
    
          return {
            content: [{
              type: "text",
              text: errorMsg
            }],
            isError: true
          };
        }
    
        let output = `행정심판례 검색 결과 (총 ${totalCount}건, ${currentPage}페이지):\n\n`;
    
        for (const appeal of appeals) {
          output += `[${appeal.행정심판재결례일련번호}] ${appeal.사건명}\n`;
          output += `  사건번호: ${appeal.사건번호 || "N/A"}\n`;
          output += `  의결일: ${appeal.의결일자 || "N/A"}\n`;
          output += `  재결청: ${appeal.재결청 || "N/A"}\n`;
          output += `  재결구분: ${appeal.재결구분명 || "N/A"}\n`;
          if (appeal.행정심판례상세링크) {
            output += `  링크: ${appeal.행정심판례상세링크}\n`;
          }
          output += `\n`;
        }
    
        output += `\n💡 전문을 조회하려면 get_admin_appeal_text(id="행정심판재결례일련번호")를 사용하세요.`;
    
        return {
          content: [{
            type: "text",
            text: output
          }]
        };
      } catch (error) {
        return formatToolError(error, "search_admin_appeals")
      }
    }
  • Zod schema defining input parameters for search_admin_appeals: query, display count (max 100), page, sort option, and optional apiKey.
    export const searchAdminAppealsSchema = z.object({
      query: z.string().optional().describe("검색 키워드 (예: '취소처분', '영업정지', '과태료')"),
      display: z.number().min(1).max(100).default(20).describe("페이지당 결과 개수 (기본값: 20, 최대: 100)"),
      page: z.number().min(1).default(1).describe("페이지 번호 (기본값: 1)"),
      sort: z.enum(["lasc", "ldes", "dasc", "ddes", "nasc", "ndes"]).optional()
        .describe("정렬 옵션: lasc/ldes (재결례명순), dasc/ddes (의결일자순), nasc/ndes (사건번호순)"),
      apiKey: z.string().optional().describe("법제처 Open API 인증키(OC). 사용자가 제공한 경우 전달"),
    });
  • Registration of the search_admin_appeals tool in the central tool registry with its name, description, schema, and handler reference.
    {
      name: "search_admin_appeals",
      description: "[행심] 행정심판례 검색.",
      schema: searchAdminAppealsSchema,
      handler: searchAdminAppeals
    },
  • Import of searchAdminAppeals and its schema from the admin-appeals module into the tool registry.
    import { searchAdminAppeals, searchAdminAppealsSchema, getAdminAppealText, getAdminAppealTextSchema } from "./tools/admin-appeals.js"
  • Query router pattern that routes queries containing '행정심판' or '행심' to the search_admin_appeals tool.
    // ── 10. 행정심판 ──
    {
      name: "admin_appeal",
      patterns: [
        /행정심판|행심/,
      ],
      tool: "search_admin_appeals",
      extract: (query) => ({
        query: query.replace(/행정심판례?|행심/g, "").replace(/\s+/g, " ").trim(),
      }),
      reason: "행정심판 키워드 → 행정심판례 검색",
      priority: 10,
    },
Behavior2/5

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

With no annotations provided, the description must carry the transparency burden. It only states 'Search admin appeal precedents,' omitting details like result format, authentication (apiKey), rate limits, or any side effects. The schema gives parameter descriptions but the description itself adds no behavioral context.

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?

The description is a single, concise sentence that immediately communicates the tool's purpose. It is front-loaded with the key function and resource, with no wasted words.

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?

Given the tool has 5 parameters, no output schema, and no annotations, the description is incomplete. It does not describe what the search returns (list of cases with metadata?), pagination behavior, or typical use cases. An agent would need to infer behavior from the parameter descriptions alone.

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?

Since schema description coverage is 100%, the baseline is 3. The description does not add any meaning beyond the schema; it is a single sentence that doesn't elaborate on parameters. The schema already explains each parameter (query, display, page, sort, apiKey) adequately.

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 specifies the action (검색/search) and the resource (행정심판례/admin appeal precedents), distinguishing it from other search tools targeting different legal documents. However, no explicit differentiation from siblings is provided beyond the name.

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?

There is no guidance on when to use this tool versus alternatives like search_precedents or search_all. The description merely states what it does without context for selection.

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