Skip to main content
Glama
hjsh200219

Saju Fortune-Telling MCP Server

by hjsh200219

check_compatibility

Analyze compatibility between two individuals using Korean Saju astrology by comparing birth dates, times, and genders to provide relationship insights.

Instructions

두 사람 궁합 분석

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
person1Yes
person2Yes

Implementation Reference

  • Main handler function for the 'check_compatibility' tool. Calculates saju data for two persons using calculateSaju and performs compatibility analysis using checkCompatibility, returning JSON result.
    export function handleCheckCompatibility(args: CheckCompatibilityArgs): string {
      const { person1, person2 } = args;
    
      // 각 사람의 사주 계산
      const sajuData1 = calculateSaju(
        person1.birthDate,
        person1.birthTime,
        person1.calendar || 'solar',
        person1.isLeapMonth || false,
        person1.gender
      );
    
      const sajuData2 = calculateSaju(
        person2.birthDate,
        person2.birthTime,
        person2.calendar || 'solar',
        person2.isLeapMonth || false,
        person2.gender
      );
    
      // 궁합 분석
      const compatibility = checkCompatibility(sajuData1, sajuData2);
    
      return JSON.stringify(compatibility);
    }
  • Zod schema for validating input to check_compatibility tool, defining structure for person1 and person2 data.
    export const CheckCompatibilitySchema = z.object({
      person1: 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('성별')
      }).describe('첫 번째 사람'),
      person2: 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('성별')
      }).describe('두 번째 사람')
    });
  • Lazy registration of the 'check_compatibility' tool schema in the toolSchemaFactories object.
    check_compatibility: () => ({
      name: 'check_compatibility',
      description: '두 사람 궁합 분석',
      inputSchema: {
        type: 'object',
        properties: {
          person1: {
            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'],
          },
          person2: {
            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'],
          },
        },
        required: ['person1', 'person2'],
      },
    }),
  • Dispatch in the main tool handler switch statement that routes 'check_compatibility' calls to handleCheckCompatibility.
    case 'check_compatibility':
      return handleCheckCompatibility(args as Parameters<typeof handleCheckCompatibility>[0]);
  • Core compatibility analysis function that performs detailed analysis including day pillar, element harmony, branch relations, and ten gods compatibility to compute overall score and advice.
    export function checkCompatibility(person1: SajuData, person2: SajuData): CompatibilityAnalysis {
      // 1. 일주 궁합 (가장 중요)
      const dayCompatibility = analyzeDayPillarCompatibility(person1, person2);
    
      // 2. 오행 조화
      const elementHarmony = analyzeElementHarmony(person1, person2);
    
      // 3. 지지 충극 관계
      const branchRelation = analyzeBranchRelation(person1, person2);
    
      // 4. 십성 궁합
      const tenGodsCompatibility = analyzeTenGodsCompatibility(person1, person2);
    
      // 종합 점수 계산
      const compatibilityScore = calculateOverallScore(
        dayCompatibility,
        elementHarmony,
        branchRelation,
        tenGodsCompatibility
      );
    
      // 장단점 분석
      const strengths: string[] = [];
      const weaknesses: string[] = [];
      const advice: string[] = [];
    
      if (dayCompatibility.score >= 70) {
        strengths.push('일주 궁합이 좋아 기본적으로 잘 맞는 사이입니다');
      } else if (dayCompatibility.score < 50) {
        weaknesses.push('일주가 충돌하여 의견 차이가 있을 수 있습니다');
        advice.push('서로의 차이를 인정하고 존중하는 자세가 필요합니다');
      }
    
      if (elementHarmony.harmony >= 70) {
        strengths.push('오행이 조화로워 서로를 보완합니다');
      } else if (elementHarmony.harmony < 50) {
        weaknesses.push('오행이 충돌하여 갈등이 생길 수 있습니다');
        advice.push('상대방의 장점을 인정하고 이해하려 노력하세요');
      }
    
      if (branchRelation.isHarmony) {
        strengths.push('지지가 조화로워 편안한 관계를 유지합니다');
      } else if (branchRelation.isConflict) {
        weaknesses.push('지지가 충돌하여 예기치 않은 문제가 발생할 수 있습니다');
        advice.push('감정적인 대립을 피하고 이성적으로 대화하세요');
      }
    
      // 십성 궁합
      if (tenGodsCompatibility.score >= 70) {
        strengths.push(tenGodsCompatibility.description);
      } else if (tenGodsCompatibility.score < 50) {
        weaknesses.push(tenGodsCompatibility.description);
        advice.push(tenGodsCompatibility.advice);
      }
    
      // 성격 궁합
      const personalityMatch = analyzePersonalityMatch(person1, person2);
      strengths.push(...personalityMatch.strengths);
      weaknesses.push(...personalityMatch.weaknesses);
      advice.push(...personalityMatch.advice);
    
      return {
        compatibilityScore,
        summary: getSummary(compatibilityScore),
        strengths,
        weaknesses,
        advice,
        elementHarmony,
      };
    }
Behavior1/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. The description only states what the tool does at a high level without revealing any behavioral traits: no information about what the analysis returns, whether it's deterministic or probabilistic, if it requires external data, rate limits, authentication needs, or error conditions. This leaves the agent completely in the dark about how the tool behaves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with just four Korean characters. While severely under-specified, it's not wordy or repetitive. Every character serves the core purpose statement, making it maximally efficient in terms of word count.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (2 nested objects with 10 total properties), no annotations, no output schema, and 0% schema description coverage, the description is completely inadequate. It doesn't explain what the tool returns, how to interpret results, what the analysis methodology is, or provide any context about the parameters. For a tool with this level of complexity, the description fails to provide necessary contextual information.

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

Parameters1/5

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

Schema description coverage is 0%, meaning none of the parameters have descriptions in the schema. The tool description provides no information about any parameters - it doesn't mention birth dates, times, calendars, gender, or any of the 10 nested properties. The agent must infer parameter meanings solely from property names like 'birthDate' and 'gender' without any semantic context from the description.

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

Purpose2/5

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

The description '두 사람 궁합 분석' (Two people compatibility analysis) states the general purpose but is vague about what type of compatibility is being analyzed (astrological, personality, etc.) and doesn't specify the method or domain. It doesn't clearly distinguish from siblings like 'analyze_saju' which might be related. The description restates the tool name concept without adding specificity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/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 like 'analyze_saju' or other sibling tools. There's no mention of prerequisites, appropriate contexts, or exclusions. The agent receives no help in selecting this tool over 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