get_nlrc_decision_text
Retrieve the full text of a Korean National Labor Relations Commission decision by providing its serial number.
Instructions
[노동위] 노동위 결정문 전문.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | 결정문 일련번호 (검색 결과에서 획득) | |
| apiKey | No | 법제처 Open API 인증키(OC). 사용자가 제공한 경우 전달 |
Implementation Reference
- src/tool-registry.ts:408-413 (registration)Tool registration: registers 'get_nlrc_decision_text' with its schema and handler function in the tool registry.
{ name: "get_nlrc_decision_text", description: "[노동위] 노동위 결정문 전문.", schema: getNlrcDecisionTextSchema, handler: getNlrcDecisionText }, - Schema definition for get_nlrc_decision_text input: requires 'id' (string) and optional 'apiKey' (string) via baseTextSchema.
export const getNlrcDecisionTextSchema = z.object(baseTextSchema); export type GetNlrcDecisionTextInput = z.infer<typeof getNlrcDecisionTextSchema>; - src/tools/committee-decisions.ts:108-113 (handler)Handler function for get_nlrc_decision_text. Delegates to getCommitteeDecisionText with target='nlrc' and committeeName='중앙노동위원회 결정문'.
export async function getNlrcDecisionText( apiClient: LawApiClient, args: GetNlrcDecisionTextInput ): Promise<{ content: Array<{ type: string, text: string }>, isError?: boolean }> { return getCommitteeDecisionText(apiClient, args, "nlrc", "중앙노동위원회 결정문"); } - Core helper getCommitteeDecisionText: fetches full decision text from the lawService.do API, parses JSON, and formats the output with basic info, judgment, summary, reasoning, referenced statutes, and full text.
async function getCommitteeDecisionText( apiClient: LawApiClient, args: { id: string; apiKey?: string }, target: string, committeeName: string ): Promise<{ content: Array<{ type: string, text: string }>, isError?: boolean }> { try { const responseText = await apiClient.fetchApi({ endpoint: "lawService.do", target, type: "JSON", extraParams: { ID: args.id }, apiKey: args.apiKey, }); let data: any; try { data = JSON.parse(responseText); } catch (err) { throw new Error("Failed to parse JSON response from API"); } const serviceKey = getServiceKey(target); if (!data[serviceKey]) { throw new Error(`${committeeName}을(를) 찾을 수 없거나 응답 형식이 올바르지 않습니다.`); } const decision = data[serviceKey]; let output = `=== ${decision.사건명 || committeeName} ===\n\n`; output += `📋 기본 정보:\n`; output += ` 사건번호: ${decision.사건번호 || "N/A"}\n`; output += ` 결정일자: ${decision.결정일자 || "N/A"}\n`; output += ` 결정유형: ${decision.결정유형 || "N/A"}\n`; if (decision.당사자) output += ` 당사자: ${decision.당사자}\n`; if (decision.피심인) output += ` 피심인: ${decision.피심인}\n`; output += `\n`; if (decision.주문) { output += `📌 주문:\n${decision.주문}\n\n`; } if (decision.결정요지 || decision.요지) { output += `📝 결정요지:\n${decision.결정요지 || decision.요지}\n\n`; } if (decision.이유) { output += `📄 이유:\n${decision.이유}\n\n`; } if (decision.참조조문) { output += `📖 참조조문:\n${decision.참조조문}\n\n`; } if (decision.결정내용 || decision.전문) { output += `📄 전문:\n${decision.결정내용 || decision.전문}\n`; } return { content: [{ type: "text", text: truncateResponse(output) }] }; } catch (error) { return formatToolError(error, `get_${target}_decision_text`); } } - src/lib/tool-chain-config.ts:61-65 (helper)Tool chain configuration: maps search_nlrc_decisions to get_nlrc_decision_text for automatic detail lookup from search results.
search_nlrc_decisions: { detailTool: "get_nlrc_decision_text", detailParam: "id", idRegex: BRACKET_ID, },