Skip to main content
Glama

get_daily_horoscope

Retrieve daily horoscope predictions for any zodiac sign, covering categories like love, career, health, wealth, or general luck.

Instructions

获取指定星座的今日运势

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
zodiacYes星座名称(中文或英文)
categoryNo运势类别luck

Implementation Reference

  • Schema definition for the get_daily_horoscope tool, including input parameters for zodiac (required) and optional category (love, career, health, wealth, luck).
    {
      name: 'get_daily_horoscope',
      description: '获取指定星座的今日运势',
      inputSchema: {
        type: 'object',
        properties: {
          zodiac: {
            type: 'string',
            description: '星座名称(中文或英文)',
            enum: Object.keys(zodiacData).concat(Object.values(zodiacData).map(z => z.name))
          },
          category: {
            type: 'string',
            description: '运势类别',
            enum: ['love', 'career', 'health', 'wealth', 'luck'],
            default: 'luck'
          }
        },
        required: ['zodiac']
      }
    },
  • The core handler implementation for get_daily_horoscope tool. It resolves the zodiac key, retrieves zodiac data, selects a random horoscope from the specified category (default 'luck'), maps category to Chinese name, and formats a markdown response with symbol, name, rating, horoscope text, and suggestions.
          case 'get_daily_horoscope': {
            const zodiacKey = getZodiacKey(args.zodiac);
            if (!zodiacKey) {
              throw new Error(`未找到星座: ${args.zodiac}`);
            }
            
            const zodiac = zodiacData[zodiacKey];
            const category = args.category || 'luck';
            const horoscope = getRandomHoroscope(category);
            
            const categoryNames = {
              love: '爱情运',
              career: '事业运',
              health: '健康运',
              wealth: '财运',
              luck: '综合运势'
            };
            
            result = {
              content: [
                {
                  type: 'text',
                  text: `# ${zodiac.symbol} ${zodiac.name} 今日${categoryNames[category]}
    
    **运势指数:** ⭐⭐⭐⭐⭐
    
    **今日运势:**
    ${horoscope}
    
    **建议:**
    - 保持积极心态
    - 注意身体健康
    - 与朋友多交流
    - 把握机会,勇敢尝试`
                }
              ]
            };
            break;
          }
  • index.js:673-681 (registration)
    Registration of the tools list handler, which exposes get_daily_horoscope (among others) via the MCP tools/list endpoint.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: tools.map(tool => ({
          name: tool.name,
          description: tool.description,
          inputSchema: tool.inputSchema
        }))
      };
    });
  • Data helper providing predefined horoscope messages for different categories (love, career, health, wealth, luck) used by get_daily_horoscope.
    const horoscopeData = {
      love: ['桃花运旺盛,单身者有机会遇到心仪对象', '感情稳定,与伴侣关系更加亲密', '需要多沟通,避免误解', '适合表白或求婚', '注意控制情绪,避免冲动'],
      career: ['工作顺利,有升职加薪的机会', '适合学习新技能,提升竞争力', '团队合作良好,项目进展顺利', '需要更加努力,克服困难', '保持耐心,等待时机'],
      health: ['身体状况良好,适合运动健身', '注意休息,避免过度劳累', '饮食要规律,多吃蔬果', '保持心情愉悦,减少压力', '定期体检,预防疾病'],
      wealth: ['财运不错,可能有意外收获', '投资需谨慎,避免冒险', '适合储蓄,为未来做准备', '避免冲动消费,理性理财', '合作项目有利可图'],
      luck: ['幸运指数高,适合尝试新事物', '贵人运旺,得到他人帮助', '保持积极心态,好运自然来', '避免冒险,稳中求进', '耐心等待,时机未到']
    };
  • Helper function to select a random horoscope message from the specified category, defaulting to 'luck'.
    function getRandomHoroscope(category) {
      const horoscopes = horoscopeData[category] || horoscopeData.luck;
      return horoscopes[Math.floor(Math.random() * horoscopes.length)];
    }

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