get_dae_un
Calculate your 10-year destiny cycle in Korean Saju astrology using birth date, time, gender, and calendar preferences to understand major life phases.
Instructions
10년 대운
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| birthDate | Yes | ||
| birthTime | Yes | ||
| calendar | No | solar | |
| isLeapMonth | No | ||
| gender | Yes |
Implementation Reference
- src/tools/get_dae_un.ts:20-68 (handler)The primary handler function implementing the 'get_dae_un' tool logic. Calculates saju data, daeun periods, formats output for current age (if specified) and lists upcoming daeun periods.export function handleGetDaeUn(args: GetDaeUnArgs): string { try { const { birthDate, birthTime, calendar = 'solar', isLeapMonth = false, gender, age, limit = 10, } = args; // 1. 사주 계산 const sajuData = calculateSaju(birthDate, birthTime, calendar, isLeapMonth, gender); // 2. 대운 계산 const daeUnPeriods = calculateDaeUn(sajuData); let result = ''; // 3. 특정 나이의 대운 조회 if (age !== undefined) { const currentDaeUn = getDaeUnAtAge(sajuData, age); if (currentDaeUn) { result += `## ${age}세 대운\n\n`; result += formatDaeUn(currentDaeUn) + '\n\n'; result += `### 대운 분석\n\n`; result += `- **천간**: ${currentDaeUn.stem} (${currentDaeUn.stemElement})\n`; result += ` - 상반기 5년(${currentDaeUn.startAge}-${currentDaeUn.startAge + 4}세)의 주요 운세 영향\n\n`; result += `- **지지**: ${currentDaeUn.branch} (${currentDaeUn.branchElement})\n`; result += ` - 하반기 5년(${currentDaeUn.startAge + 5}-${currentDaeUn.endAge}세)의 주요 운세 영향\n\n`; } else { result += `${age}세에 해당하는 대운 정보를 찾을 수 없습니다.\n\n`; } } // 4. 전체 대운 목록 result += `## 전체 대운 목록\n\n`; result += formatDaeUnList(daeUnPeriods, limit); return result; } catch (error) { if (error instanceof Error) { return `오류가 발생했습니다: ${error.message}`; } return '알 수 없는 오류가 발생했습니다.'; } }
- src/core/tool-handler.ts:38-39 (registration)Tool registration in the central tool dispatcher switch statement, routing 'get_dae_un' calls to the specific handler.case 'get_dae_un': return handleGetDaeUn(args as Parameters<typeof handleGetDaeUn>[0]);
- src/core/tool-definitions.ts:114-128 (registration)Tool definition including name, description, and input schema registration for lazy-loading in the MCP tool factory.get_dae_un: () => ({ name: 'get_dae_un', description: '10년 대운', inputSchema: { type: 'object', properties: { birthDate: { type: 'string' }, birthTime: { type: 'string' }, calendar: { type: 'string', enum: ['solar', 'lunar'], default: 'solar' }, isLeapMonth: { type: 'boolean', default: false }, gender: { type: 'string', enum: ['male', 'female'] }, }, required: ['birthDate', 'birthTime', 'gender'], }, }),
- src/schemas/index.ts:105-111 (schema)Zod schema for input validation of the get_dae_un tool parameters.export const GetDaeUnSchema = z.object({ birthDate: DateSchema.describe('생년월일 (YYYY-MM-DD)'), birthTime: TimeSchema.describe('출생 시간 (HH:mm)'), calendar: CalendarTypeSchema.default('solar').describe('달력 타입'), isLeapMonth: z.boolean().default(false).describe('음력 윤달 여부'), gender: GenderSchema.describe('성별') });
- src/tools/index.ts:16-16 (registration)Re-export of the handler function from the tools index module, making it available for import in tool-handler.ts.export { handleGetDaeUn } from './get_dae_un.js';