Skip to main content
Glama

get_rising_sign

Calculate your rising sign using birth time, location, and date to determine the zodiac sign ascending on the eastern horizon at birth.

Instructions

计算上升星座,需要出生时间、地点和日期

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
birthHourYes出生小时(0-23)
birthMinuteYes出生分钟(0-59)
latitudeYes出生地纬度(-90到90)
longitudeYes出生地经度(-180到180)
birthMonthYes出生月份(1-12)
birthDayYes出生日期(1-31)
birthYearYes出生年份(1900-2100)

Implementation Reference

  • Main execution logic for 'get_rising_sign' tool. Computes rising sign using astronomical calculations (Julian day, sidereal time, ascendant) and formats detailed response with sun sign, rising sign info, and explanations.
          case 'get_rising_sign': {
            const birthDate = new Date(args.birthYear, args.birthMonth - 1, args.birthDay);
            const risingSignKey = calculateRisingSign(
              args.birthHour, 
              args.birthMinute, 
              args.latitude, 
              args.longitude, 
              birthDate
            );
            
            const risingSign = risingSignData[risingSignKey];
            const zodiacKey = getZodiacByDate(args.birthMonth, args.birthDay);
            const zodiac = zodiacData[zodiacKey];
            
            // 计算详细的天文数据用于显示
            const birthTime = args.birthHour + args.birthMinute / 60;
            const year = birthDate.getFullYear();
            const month = birthDate.getMonth() + 1;
            const day = birthDate.getDate();
            
            // 计算儒略日
            let jd = 0;
            if (month <= 2) {
              const tempYear = year - 1;
              const tempMonth = month + 12;
              const a = Math.floor(tempYear / 100);
              const b = 2 - a + Math.floor(a / 4);
              jd = Math.floor(365.25 * (tempYear + 4716)) + 
                   Math.floor(30.6001 * (tempMonth + 1)) + 
                   day + b - 1524.5 + birthTime / 24;
            } else {
              const a = Math.floor(year / 100);
              const b = 2 - a + Math.floor(a / 4);
              jd = Math.floor(365.25 * (year + 4716)) + 
                   Math.floor(30.6001 * (month + 1)) + 
                   day + b - 1524.5 + birthTime / 24;
            }
            
            // 计算恒星时
            const t = (jd - 2451545.0) / 36525;
            let gst = 280.46061837 + 360.98564736629 * (jd - 2451545.0) + 
                      0.000387933 * t * t - t * t * t / 38710000;
            gst = gst % 360;
            if (gst < 0) gst += 360;
            
            // 计算地方恒星时
            let lst = gst + args.longitude;
            lst = lst % 360;
            if (lst < 0) lst += 360;
            
            result = {
              content: [
                {
                  type: 'text',
                  text: `# 上升星座查询结果
    
    **出生信息:**
    - 出生时间: ${args.birthYear}年${args.birthMonth}月${args.birthDay}日 ${args.birthHour}:${args.birthMinute.toString().padStart(2, '0')}
    - 出生地点: 纬度 ${args.latitude}°, 经度 ${args.longitude}°
    
    **天文计算数据:**
    - 儒略日: ${jd.toFixed(6)}
    - 格林威治恒星时: ${gst.toFixed(2)}°
    - 地方恒星时: ${lst.toFixed(2)}°
    
    **星座信息:**
    - 太阳星座: ${zodiac.symbol} ${zodiac.name} (${zodiac.english})
    - 上升星座: ${risingSign.symbol} ${risingSign.name} (${risingSign.english})
    
    **上升星座特征:**
    ${risingSign.description}
    
    **外貌特征:**
    ${risingSign.appearance}
    
    **性格特点:**
    ${risingSign.traits.map(trait => `- ${trait}`).join('\n')}
    
    **个性分析:**
    ${risingSign.personality}
    
    **计算说明:**
    此计算基于准确的天文算法,包括:
    - 儒略日计算
    - 格林威治恒星时计算
    - 地方恒星时计算
    - 上升点黄经计算
    - 星座边界确定
    
    **上升星座的意义:**
    上升星座代表一个人给外界的第一印象,以及面对新环境时的表现方式。它反映了我们如何与世界互动,以及他人如何看待我们。`
                }
              ]
            };
            break;
  • index.js:521-572 (registration)
    Tool registration in the tools array provided to ListToolsRequestSchema, defining name, description, and detailed input schema for birth data.
    {
      name: 'get_rising_sign',
      description: '计算上升星座,需要出生时间、地点和日期',
      inputSchema: {
        type: 'object',
        properties: {
          birthHour: {
            type: 'integer',
            description: '出生小时(0-23)',
            minimum: 0,
            maximum: 23
          },
          birthMinute: {
            type: 'integer',
            description: '出生分钟(0-59)',
            minimum: 0,
            maximum: 59
          },
          latitude: {
            type: 'number',
            description: '出生地纬度(-90到90)',
            minimum: -90,
            maximum: 90
          },
          longitude: {
            type: 'number',
            description: '出生地经度(-180到180)',
            minimum: -180,
            maximum: 180
          },
          birthMonth: {
            type: 'integer',
            description: '出生月份(1-12)',
            minimum: 1,
            maximum: 12
          },
          birthDay: {
            type: 'integer',
            description: '出生日期(1-31)',
            minimum: 1,
            maximum: 31
          },
          birthYear: {
            type: 'integer',
            description: '出生年份(1900-2100)',
            minimum: 1900,
            maximum: 2100
          }
        },
        required: ['birthHour', 'birthMinute', 'latitude', 'longitude', 'birthMonth', 'birthDay', 'birthYear']
      }
    },
  • Input schema defining parameters and validation for the get_rising_sign tool (hours, minutes, lat/long, birth date).
    inputSchema: {
      type: 'object',
      properties: {
        birthHour: {
          type: 'integer',
          description: '出生小时(0-23)',
          minimum: 0,
          maximum: 23
        },
        birthMinute: {
          type: 'integer',
          description: '出生分钟(0-59)',
          minimum: 0,
          maximum: 59
        },
        latitude: {
          type: 'number',
          description: '出生地纬度(-90到90)',
          minimum: -90,
          maximum: 90
        },
        longitude: {
          type: 'number',
          description: '出生地经度(-180到180)',
          minimum: -180,
          maximum: 180
        },
        birthMonth: {
          type: 'integer',
          description: '出生月份(1-12)',
          minimum: 1,
          maximum: 12
        },
        birthDay: {
          type: 'integer',
          description: '出生日期(1-31)',
          minimum: 1,
          maximum: 31
        },
        birthYear: {
          type: 'integer',
          description: '出生年份(1900-2100)',
          minimum: 1900,
          maximum: 2100
        }
      },
      required: ['birthHour', 'birthMinute', 'latitude', 'longitude', 'birthMonth', 'birthDay', 'birthYear']
    }
  • Primary helper function implementing the astronomical algorithm to compute rising sign (ascendant) from birth time and location. Includes nested helpers for Julian day, sidereal times, and sign mapping.
    function calculateRisingSign(birthHour, birthMinute, latitude, longitude, birthDate) {
      // 准确计算上升星座需要以下步骤:
      // 1. 计算恒星时 (Sidereal Time)
      // 2. 计算地方恒星时 (Local Sidereal Time)
      // 3. 计算上升点 (Ascendant)
      
      // 将出生时间转换为小数小时
      const birthTime = birthHour + birthMinute / 60;
      
      // 获取出生日期的年、月、日
      const year = birthDate.getFullYear();
      const month = birthDate.getMonth() + 1; // getMonth() 返回 0-11
      const day = birthDate.getDate();
      
      // 1. 计算儒略日 (Julian Day)
      function calculateJulianDay(year, month, day, hour) {
        if (month <= 2) {
          year -= 1;
          month += 12;
        }
        
        const a = Math.floor(year / 100);
        const b = 2 - a + Math.floor(a / 4);
        
        const jd = Math.floor(365.25 * (year + 4716)) + 
                   Math.floor(30.6001 * (month + 1)) + 
                   day + b - 1524.5 + hour / 24;
        
        return jd;
      }
      
      // 2. 计算格林威治恒星时 (Greenwich Sidereal Time)
      function calculateGST(julianDay) {
        const t = (julianDay - 2451545.0) / 36525;
        
        // 计算平均恒星时
        let gst = 280.46061837 + 360.98564736629 * (julianDay - 2451545.0) + 
                  0.000387933 * t * t - t * t * t / 38710000;
        
        // 标准化到 0-360 度
        gst = gst % 360;
        if (gst < 0) gst += 360;
        
        return gst;
      }
      
      // 3. 计算地方恒星时 (Local Sidereal Time)
      function calculateLST(gst, longitude) {
        let lst = gst + longitude;
        
        // 标准化到 0-360 度
        lst = lst % 360;
        if (lst < 0) lst += 360;
        
        return lst;
      }
      
      // 4. 计算上升点 (Ascendant)
      function calculateAscendant(lst, latitude) {
        // 黄道倾角 (Obliquity of the Ecliptic)
        const obliquity = 23.4397; // 度
        
        // 将角度转换为弧度
        const lstRad = lst * Math.PI / 180;
        const latRad = latitude * Math.PI / 180;
        const oblRad = obliquity * Math.PI / 180;
        
        // 计算上升点的黄经
        const ascRad = Math.atan2(
          Math.cos(oblRad) * Math.sin(lstRad),
          Math.cos(lstRad) * Math.cos(latRad) - Math.sin(oblRad) * Math.sin(latRad)
        );
        
        let ascendant = ascRad * 180 / Math.PI;
        
        // 标准化到 0-360 度
        if (ascendant < 0) ascendant += 360;
        
        return ascendant;
      }
      
      // 5. 根据上升点黄经确定上升星座
      function getRisingSignFromAscendant(ascendant) {
        // 星座边界(黄经度数)
        const zodiacBoundaries = [
          { sign: 'aries', start: 0, end: 30 },
          { sign: 'taurus', start: 30, end: 60 },
          { sign: 'gemini', start: 60, end: 90 },
          { sign: 'cancer', start: 90, end: 120 },
          { sign: 'leo', start: 120, end: 150 },
          { sign: 'virgo', start: 150, end: 180 },
          { sign: 'libra', start: 180, end: 210 },
          { sign: 'scorpio', start: 210, end: 240 },
          { sign: 'sagittarius', start: 240, end: 270 },
          { sign: 'capricorn', start: 270, end: 300 },
          { sign: 'aquarius', start: 300, end: 330 },
          { sign: 'pisces', start: 330, end: 360 }
        ];
        
        for (const boundary of zodiacBoundaries) {
          if (ascendant >= boundary.start && ascendant < boundary.end) {
            return boundary.sign;
          }
        }
        
        // 处理边界情况
        if (ascendant >= 330) return 'pisces';
        return 'aries'; // 默认值
      }
      
      try {
        // 执行计算
        const julianDay = calculateJulianDay(year, month, day, birthTime);
        const gst = calculateGST(julianDay);
        const lst = calculateLST(gst, longitude);
        const ascendant = calculateAscendant(lst, latitude);
        const risingSign = getRisingSignFromAscendant(ascendant);
        
        return risingSign;
      } catch (error) {
        console.error('上升星座计算错误:', error);
        // 如果计算失败,返回基于时间的简化计算
        return calculateRisingSignSimple(birthHour, birthMinute, latitude, longitude, birthDate);
      }
    }
  • Helper function to normalize and lookup rising sign name from user input to internal key.
    function getRisingSignKey(risingSignName) {
      const lowerName = risingSignName.toLowerCase();
      if (risingSignData[lowerName]) {
        return lowerName;
      }
      
      for (const [key, data] of Object.entries(risingSignData)) {
        if (data.name === risingSignName || data.english.toLowerCase() === lowerName) {
          return key;
        }
      }
      return null;
    }
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 states the tool calculates a rising sign but doesn't describe the output format, error conditions, computational complexity, or any side effects. For a calculation tool with 7 required parameters, this leaves significant gaps in understanding how it 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 - a single sentence that states the purpose and lists the three categories of required inputs. Every word earns its place with zero waste, making it perfectly front-loaded and efficient.

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 calculation tool with 7 required parameters and no output schema, the description is inadequate. It doesn't explain what the tool returns (e.g., zodiac sign name, degree, house position), how precise the calculation is, or what happens with invalid inputs. With no annotations and no output schema, users have no idea what to expect from this tool.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all 7 parameters thoroughly with ranges and descriptions. The description adds minimal value by grouping parameters into '出生时间、地点和日期' (birth time, location, and date) but doesn't provide additional context beyond what's in the schema. Baseline 3 is appropriate when schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the tool's purpose: '计算上升星座' (calculate rising sign) with specific required inputs (birth time, location, and date). It distinguishes from siblings like get_rising_sign_info (which likely provides information rather than calculation) and get_zodiac_by_date (which uses date only). However, it doesn't explicitly contrast with all siblings, keeping it from a perfect score.

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. It lists required inputs but doesn't mention when to choose this over get_rising_sign_info or other zodiac-related tools, nor does it specify any prerequisites or exclusions for usage.

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/jlankellii/star-mcp'

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