Skip to main content
Glama
hjsh200219

Saju Fortune-Telling MCP Server

by hjsh200219

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
NameRequiredDescriptionDefault
birthDateYes
birthTimeYes
calendarNosolar
isLeapMonthNo
genderYes

Implementation Reference

  • 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 '알 수 없는 오류가 발생했습니다.'; } }
  • 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]);
  • 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'], }, }),
  • 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('성별') });
  • 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';

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/hjsh200219/fortuneteller'

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