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
| Name | Required | Description | Default |
|---|---|---|---|
| count | Yes | Number of cards to draw (1-78) |
Implementation Reference
- src/tools/tarot-tools.ts:15-28 (handler)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; } - src/index.ts:29-43 (schema)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)', }, }, }, }, ]; - src/index.ts:167-178 (handler)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), }, ], }; } - src/index.ts:24-28 (helper)The DrawCard interface defining the return shape for draw_cards: a card (TarotCard), position (string), and isReversed (boolean).
); // Define available tools const TOOLS: Tool[] = [ {