Skip to main content
Glama
abdul-hamid-achik

Tarot MCP Server

draw_cards

Draw between 1 and 78 tarot cards from a complete deck for personalized readings and divination.

Instructions

Draw a specified number of tarot cards

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countYesNumber of cards to draw (1-78)

Implementation Reference

  • The core handler for the draw_cards tool. Takes a count, shuffles the full deck, and returns DrawCard objects (each with card data, position label, and random reversed status).
    drawCards(count: number): DrawCard[] {
      const shuffled = this.shuffleArray(allCards);
      const drawnCards: DrawCard[] = [];
      
      for (let i = 0; i < count && i < shuffled.length; i++) {
        drawnCards.push({
          card: shuffled[i],
          position: `Position ${i + 1}`,
          isReversed: Math.random() < 0.5
        });
      }
      
      return drawnCards;
    }
  • Input schema and registration for the draw_cards tool. Defines name 'draw_cards', description, and expects a 'count' number (1-78) as required input.
      name: 'draw_cards',
      description: 'Draw a specified number of tarot cards',
      inputSchema: {
        type: 'object',
        properties: {
          count: {
            type: 'number',
            description: 'Number of cards to draw (1-78)',
            minimum: 1,
            maximum: 78,
          },
        },
        required: ['count'],
      },
    },
  • src/index.ts:27-148 (registration)
    The TOOLS array where 'draw_cards' is registered alongside all other tools (lines 28-43).
    const TOOLS: Tool[] = [
      {
        name: 'draw_cards',
        description: 'Draw a specified number of tarot cards',
        inputSchema: {
          type: 'object',
          properties: {
            count: {
              type: 'number',
              description: 'Number of cards to draw (1-78)',
              minimum: 1,
              maximum: 78,
            },
          },
          required: ['count'],
        },
      },
      {
        name: 'perform_reading',
        description: 'Perform a tarot reading with a specific spread',
        inputSchema: {
          type: 'object',
          properties: {
            spreadId: {
              type: 'string',
              description: 'ID of the spread to use (e.g., "celtic-cross", "past-present-future")',
            },
            question: {
              type: 'string',
              description: 'Optional question for the reading',
            },
          },
          required: ['spreadId'],
        },
      },
      {
        name: 'interpret_reading',
        description: 'Get a detailed interpretation of a tarot reading',
        inputSchema: {
          type: 'object',
          properties: {
            reading: {
              type: 'object',
              description: 'The reading object returned from perform_reading',
            },
          },
          required: ['reading'],
        },
      },
      {
        name: 'get_card_meaning',
        description: 'Get detailed information about a specific tarot card',
        inputSchema: {
          type: 'object',
          properties: {
            cardName: {
              type: 'string',
              description: 'Name of the card (e.g., "The Fool", "Three of Cups")',
            },
          },
          required: ['cardName'],
        },
      },
      {
        name: 'list_spreads',
        description: 'List all available tarot spreads',
        inputSchema: {
          type: 'object',
          properties: {},
        },
      },
      {
        name: 'get_spread_info',
        description: 'Get detailed information about a specific spread',
        inputSchema: {
          type: 'object',
          properties: {
            spreadId: {
              type: 'string',
              description: 'ID of the spread',
            },
          },
          required: ['spreadId'],
        },
      },
      {
        name: 'daily_card',
        description: 'Draw a single card for daily guidance',
        inputSchema: {
          type: 'object',
          properties: {},
        },
      },
      {
        name: 'search_cards',
        description: 'Search for tarot cards by keyword',
        inputSchema: {
          type: 'object',
          properties: {
            query: {
              type: 'string',
              description: 'Search query (searches names, keywords, and descriptions)',
            },
          },
          required: ['query'],
        },
      },
      {
        name: 'list_all_cards',
        description: 'List all 78 tarot cards',
        inputSchema: {
          type: 'object',
          properties: {
            arcana: {
              type: 'string',
              enum: ['major', 'minor', 'all'],
              description: 'Filter by arcana type (default: all)',
            },
          },
        },
      },
    ];
  • The CallToolRequestSchema handler case for 'draw_cards'. Extracts the count argument, calls tarotTools.drawCards(count), and returns the result as JSON.
    case 'draw_cards': {
      const count = args.count as number;
      const cards = tarotTools.drawCards(count);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(cards, null, 2),
          },
        ],
      };
    }
  • The DrawCard interface defining the return shape for draw_cards: a card (TarotCard), position (string), and isReversed (boolean).
    );
    
    // Define available tools
    const TOOLS: Tool[] = [
      {
Behavior2/5

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

No annotations provided; description lacks details on randomness, deck state, or side effects, which are important for a draw operation.

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

Conciseness3/5

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

Single short sentence, but lacks structure; could benefit from additional context while remaining concise.

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?

No output schema and no description of what the tool returns (e.g., card names, images), leaving agents uncertain about the response.

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 coverage is 100% and description adds no extra meaning beyond the schema description for the count parameter.

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

Purpose5/5

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

The description clearly specifies the verb 'Draw' and the resource 'tarot cards', differentiating from siblings like 'daily_card' and 'perform_reading'.

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?

No guidance on when to use this tool versus alternatives, such as for simple draws vs. complex readings.

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/abdul-hamid-achik/tarot-mcp'

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