Skip to main content
Glama
hjsh200219

Saju Fortune-Telling MCP Server

by hjsh200219

get_daily_fortune

Retrieve personalized daily fortune predictions using Korean Saju astrology based on birth details, gender, and target date to guide daily decisions.

Instructions

일일 운세

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
birthDateYes
birthTimeYes
calendarNosolar
isLeapMonthNo
genderYes
targetDateYesYYYY-MM-DD

Implementation Reference

  • The core handler function implementing the logic for the 'get_daily_fortune' tool. Validates input date, computes saju data, generates daily fortune using helper, and returns JSON.
    export function handleGetDailyFortune(args: GetDailyFortuneArgs): string { const { birthDate, birthTime, calendar = 'solar', isLeapMonth = false, gender, targetDate, } = args; // 입력 검증 if (!isValidDate(targetDate)) { throw new Error(`유효하지 않은 날짜 형식입니다: ${targetDate}. YYYY-MM-DD 형식을 사용하세요.`); } // 사주 계산 const sajuData = calculateSaju(birthDate, birthTime, calendar, isLeapMonth, gender); // 일일 운세 생성 const dailyFortune = getDailyFortune(sajuData, targetDate); return JSON.stringify(dailyFortune); }
  • MCP tool schema definition for 'get_daily_fortune', including input schema and metadata.
    get_daily_fortune: () => ({ name: 'get_daily_fortune', description: '일일 운세', 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'] }, targetDate: { type: 'string', description: 'YYYY-MM-DD' }, }, required: ['birthDate', 'birthTime', 'gender', 'targetDate'], }, }),
  • Registration in the main tool dispatcher/switch statement that routes 'get_daily_fortune' calls to the handler function.
    case 'get_daily_fortune': return handleGetDailyFortune(args as Parameters<typeof handleGetDailyFortune>[0]);
  • Zod validation schema for GetDailyFortune input parameters.
    export const GetDailyFortuneSchema = z.object({ birthDate: DateSchema.describe('생년월일 (YYYY-MM-DD)'), birthTime: TimeSchema.describe('출생 시간 (HH:mm)'), targetDate: DateSchema.describe('운세를 볼 날짜 (YYYY-MM-DD)'), calendar: CalendarTypeSchema.default('solar').describe('달력 타입'), isLeapMonth: z.boolean().default(false).describe('음력 윤달 여부'), gender: GenderSchema.describe('성별') });
  • Helper function that generates the daily fortune data based on saju and target date using seeded random for variability.
    export function getDailyFortune(sajuData: SajuData, date: string): DailyFortune { const targetDate = new Date(date); const seed = generateDateSeed(targetDate, sajuData); const dayElement = sajuData.day.stemElement; // 날짜 기반 운세 변동 const dateNumber = targetDate.getDate(); const monthNumber = targetDate.getMonth() + 1; const variance = ((dateNumber + monthNumber) % 20) - 10; // -10 ~ +10 // 시드 기반 변동 (-10 ~ +10) const getVariance = (offset: number) => { return (seededRandom(seed + offset) - 0.5) * 20; }; return { date, overallLuck: Math.round(Math.min(100, Math.max(30, 70 + variance))), wealthLuck: Math.round(Math.min(100, Math.max(30, 65 + variance + getVariance(1)))), careerLuck: Math.round(Math.min(100, Math.max(30, 75 + variance + getVariance(2)))), healthLuck: Math.round(Math.min(100, Math.max(30, 70 + variance + getVariance(3)))), loveLuck: Math.round(Math.min(100, Math.max(30, 68 + variance + getVariance(4)))), luckyColor: WUXING_DATA[dayElement].color[0]!, luckyDirection: WUXING_DATA[dayElement].direction, advice: `오늘은 ${dayElement} 기운이 강한 날입니다. ${WUXING_DATA[dayElement].personality[0]}하게 행동하세요.`, }; }

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