Skip to main content
Glama
hjsh200219

Saju Fortune-Telling MCP Server

by hjsh200219

get_fortune_by_period

Analyze Korean Saju fortune-telling for specific time periods using birth details to provide personalized destiny insights based on year, month, hour, or multi-year cycles.

Instructions

시간대별 운세 (year/month/hour/multi-year)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
birthDateYes
birthTimeYes
calendarNosolar
isLeapMonthNo
genderYes
periodTypeYesyear:YYYY | month:YYYY-MM | hour:YYYY-MM-DD HH:mm | multi-year:연속
targetNo기간 (periodType에 맞는 형식)
countNomulti-year용

Implementation Reference

  • Main handler function executing the tool logic for different fortune periods (year, multi-year, month, hour) using saju analysis.
    export function handleGetFortuneByPeriod(args: GetFortuneByPeriodArgs): string {
      const {
        birthDate,
        birthTime,
        calendar = 'solar',
        isLeapMonth = false,
        gender,
        periodType,
        target,
        count = 5,
      } = args;
    
      // 사주 계산
      const sajuData = calculateSaju(birthDate, birthTime, calendar, isLeapMonth, gender);
    
      switch (periodType) {
        case 'year': {
          if (!target) {
            throw new Error('year 조회 시 target (YYYY) 필수');
          }
          const year = parseInt(target, 10);
          if (isNaN(year)) {
            throw new Error(`유효하지 않은 연도: ${target}`);
          }
          const seUn = analyzeSeUn(sajuData, year);
          return JSON.stringify(seUn);
        }
    
        case 'multi-year': {
          const startYear = target ? parseInt(target, 10) : new Date().getFullYear();
          if (isNaN(startYear)) {
            throw new Error(`유효하지 않은 연도: ${target}`);
          }
          const seUnList = getMultipleSeUn(sajuData, startYear, count);
          return JSON.stringify({ years: seUnList, count: seUnList.length });
        }
    
        case 'month': {
          if (!target) {
            throw new Error('month 조회 시 target (YYYY-MM) 필수');
          }
          const parts = target.split('-');
          if (parts.length !== 2) {
            throw new Error(`잘못된 월 형식: ${target}. YYYY-MM 형식 사용`);
          }
          const year = parseInt(parts[0]!, 10);
          const month = parseInt(parts[1]!, 10);
          if (isNaN(year) || isNaN(month) || month < 1 || month > 12) {
            throw new Error(`유효하지 않은 월: ${target}`);
          }
          // 해당 연도의 세운 분석하여 yearStem 가져오기
          const seUn = analyzeSeUn(sajuData, year);
          const wolUn = analyzeWolUn(sajuData, year, month, seUn.stem);
          return JSON.stringify(wolUn);
        }
    
        case 'hour': {
          if (!target) {
            throw new Error('hour 조회 시 target (YYYY-MM-DD HH:mm) 필수');
          }
          const parts = target.split(' ');
          if (parts.length !== 2) {
            throw new Error(`잘못된 일시 형식: ${target}. YYYY-MM-DD HH:mm 형식 사용`);
          }
          const timePart = parts[1];
          const hour = parseInt(timePart!.split(':')[0]!, 10);
          if (isNaN(hour) || hour < 0 || hour > 23) {
            throw new Error(`유효하지 않은 시간: ${hour}`);
          }
          // analyzeIljin은 Date와 SajuData를 받음
          const targetDate = new Date(target.replace(' ', 'T'));
          const ilJin = analyzeIljin(targetDate, sajuData);
          return JSON.stringify(ilJin);
        }
    
        default:
          throw new Error(`알 수 없는 periodType: ${periodType}`);
      }
    }
  • TypeScript interface defining input parameters for the get_fortune_by_period handler.
    export interface GetFortuneByPeriodArgs {
      birthDate: string;
      birthTime: string;
      calendar?: CalendarType;
      isLeapMonth?: boolean;
      gender: Gender;
      periodType: PeriodType;
      target?: string; // YYYY (year), YYYY-MM (month), YYYY-MM-DD HH:mm (hour)
      count?: number; // multi-year용 조회 개수
    }
  • MCP tool schema definition including name, description, and input schema for get_fortune_by_period.
    get_fortune_by_period: () => ({
      name: 'get_fortune_by_period',
      description: '시간대별 운세 (year/month/hour/multi-year)',
      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'] },
          periodType: {
            type: 'string',
            enum: ['year', 'month', 'hour', 'multi-year'],
            description: 'year:YYYY | month:YYYY-MM | hour:YYYY-MM-DD HH:mm | multi-year:연속',
          },
          target: { type: 'string', description: '기간 (periodType에 맞는 형식)' },
          count: { type: 'number', default: 5, description: 'multi-year용' },
        },
        required: ['birthDate', 'birthTime', 'gender', 'periodType'],
      },
    }),
  • Dispatch/registration of the get_fortune_by_period tool call to its handler function.
    case 'get_fortune_by_period':
      return handleGetFortuneByPeriod(args as Parameters<typeof handleGetFortuneByPeriod>[0]);
  • Re-export of the handler function enabling its import in tool-handler.
    export { handleGetFortuneByPeriod } from './get_fortune_by_period.js';
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It only states what the tool does (fortune by period) without explaining what the output looks like, whether there are rate limits, authentication requirements, or any side effects. For a fortune-telling tool with 8 parameters and no output schema, this leaves significant behavioral questions unanswered.

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 extremely concise - just a single Korean phrase with English period types in parentheses. While this is efficient, it may be too brief given the tool's complexity. The information is front-loaded but lacks necessary elaboration for a tool with 8 parameters and no output schema.

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?

For a fortune-telling tool with 8 parameters, 38% schema coverage, no annotations, and no output schema, the description is inadequate. It doesn't explain what fortune information is returned, how to interpret results, or provide sufficient context about the cultural/astrological system being used. The description leaves too many questions unanswered for effective tool use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 38%, meaning most parameters lack documentation in the schema. The description provides no additional parameter information beyond the basic Korean phrase '시간대별 운세' which translates to 'fortune by time period.' It doesn't explain what birthDate/birthTime formats are expected, what the periodType values mean in practice, or how target and count parameters interact.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description '시간대별 운세 (year/month/hour/multi-year)' states the tool provides fortune-telling by time period, which is a clear purpose. However, it's somewhat vague about what specific fortune information is returned and doesn't distinguish this tool from sibling fortune-related tools like 'get_daily_fortune' or 'analyze_saju' beyond the time period focus.

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?

The description provides no guidance on when to use this tool versus alternatives. There are multiple fortune-related sibling tools (analyze_saju, get_daily_fortune, check_compatibility), but the description doesn't explain what makes this period-based fortune tool distinct or when it's preferable to use daily fortune analysis or other options.

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

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