Skip to main content
Glama

get_zodiac_by_date

Determine your zodiac sign by entering your birth month and day. This tool calculates astrological signs based on date ranges for horoscope analysis.

Instructions

根据出生日期确定星座

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
monthYes出生月份(1-12)
dayYes出生日期(1-31)

Implementation Reference

  • Core handler function that computes the zodiac sign based on birth month and day using if-else chains for date ranges.
    function getZodiacByDate(month, day) {
      if ((month === 3 && day >= 21) || (month === 4 && day <= 19)) return 'aries';
      if ((month === 4 && day >= 20) || (month === 5 && day <= 20)) return 'taurus';
      if ((month === 5 && day >= 21) || (month === 6 && day <= 21)) return 'gemini';
      if ((month === 6 && day >= 22) || (month === 7 && day <= 22)) return 'cancer';
      if ((month === 7 && day >= 23) || (month === 8 && day <= 22)) return 'leo';
      if ((month === 8 && day >= 23) || (month === 9 && day <= 22)) return 'virgo';
      if ((month === 9 && day >= 23) || (month === 10 && day <= 23)) return 'libra';
      if ((month === 10 && day >= 24) || (month === 11 && day <= 22)) return 'scorpio';
      if ((month === 11 && day >= 23) || (month === 12 && day <= 21)) return 'sagittarius';
      if ((month === 12 && day >= 22) || (month === 1 && day <= 19)) return 'capricorn';
      if ((month === 1 && day >= 20) || (month === 2 && day <= 18)) return 'aquarius';
      if ((month === 2 && day >= 19) || (month === 3 && day <= 20)) return 'pisces';
      return null;
    }
  • Tool schema definition including input parameters for month and day with validation constraints.
    {
      name: 'get_zodiac_by_date',
      description: '根据出生日期确定星座',
      inputSchema: {
        type: 'object',
        properties: {
          month: {
            type: 'integer',
            description: '出生月份(1-12)',
            minimum: 1,
            maximum: 12
          },
          day: {
            type: 'integer',
            description: '出生日期(1-31)',
            minimum: 1,
            maximum: 31
          }
        },
        required: ['month', 'day']
      }
    },
  • index.js:673-681 (registration)
    Registration of tools list handler which exposes the get_zodiac_by_date tool via the tools array.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: tools.map(tool => ({
          name: tool.name,
          description: tool.description,
          inputSchema: tool.inputSchema
        }))
      };
    });
  • MCP tool call dispatcher case that handles the get_zodiac_by_date request, computes the zodiac, and returns formatted response.
          case 'get_zodiac_by_date': {
            const zodiacKey = getZodiacByDate(args.month, args.day);
            if (!zodiacKey) {
              throw new Error('日期无效');
            }
            
            const zodiac = zodiacData[zodiacKey];
            
            result = {
              content: [
                {
                  type: 'text',
                  text: `# 生日星座查询结果
    
    **出生日期:** ${args.month}月${args.day}日
    **对应星座:** ${zodiac.symbol} ${zodiac.name} (${zodiac.english})
    **日期范围:** ${zodiac.dateRange}
    
    **基本信息:**
    - 元素: ${zodiac.element}
    - 性质: ${zodiac.quality}
    - 守护星: ${zodiac.ruler}
    
    **性格特点:**
    ${zodiac.traits.map(trait => `- ${trait}`).join('\n')}`
                }
              ]
            };
            break;
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool 'determines' zodiac signs, implying a read-only lookup operation, but doesn't mention any behavioral traits like error handling for invalid dates, cultural assumptions (e.g., Western zodiac), or output format. This leaves significant gaps for a tool with no annotation coverage.

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 and front-loaded with a single sentence that directly states the tool's purpose. There is no wasted text, and every word earns its place by clearly communicating the core functionality without unnecessary elaboration.

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?

Given the lack of annotations and output schema, the description is incomplete for effective tool use. It doesn't explain what the tool returns (e.g., zodiac name, symbol, dates), how it handles invalid inputs, or any dependencies on sibling tools. For a lookup tool with no structured output, more context is needed to understand the full behavior.

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?

The description adds no parameter semantics beyond what the input schema already provides. With 100% schema description coverage, both parameters (month and day) are fully documented in the schema with descriptions and constraints. The description doesn't compensate with additional context like date format examples or edge cases, meeting the baseline for high schema coverage.

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: '根据出生日期确定星座' (determine zodiac sign based on birth date). This is a specific verb+resource combination that explains what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'get_zodiac_info' or 'get_rising_sign', which might provide related information.

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. With siblings like 'get_zodiac_info' and 'get_rising_sign', there's no indication of whether this tool is for basic lookup, detailed information, or compatibility purposes. The agent must infer usage from the name alone.

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