interpret_reading
Interpret a tarot reading to receive a detailed analysis of each card's meaning and position, providing clarity and guidance.
Instructions
Get a detailed interpretation of a tarot reading
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reading | Yes | The reading object returned from perform_reading |
Implementation Reference
- src/tools/tarot-tools.ts:52-82 (handler)The interpretReading method builds a formatted interpretation string from a TarotReading object, including spread name, question, card positions, orientations, meanings, keywords, and an overall interpretation generated by generateOverallInterpretation().
interpretReading(reading: TarotReading): string { const spread = spreads.find(s => s.name === reading.spread); if (!spread) { return 'Unable to interpret reading - spread not found'; } let interpretation = `# ${reading.spread} Reading\n\n`; if (reading.question) { interpretation += `**Question:** ${reading.question}\n\n`; } interpretation += '## Cards Drawn:\n\n'; reading.cards.forEach((drawCard, index) => { const position = spread.positions[index]; const card = drawCard.card; const orientation = drawCard.isReversed ? 'Reversed' : 'Upright'; const meaning = drawCard.isReversed ? card.reversedMeaning : card.uprightMeaning; interpretation += `### ${position.name}: ${card.name} (${orientation})\n`; interpretation += `**Position Meaning:** ${position.meaning}\n`; interpretation += `**Card Meaning:** ${meaning}\n`; interpretation += `**Keywords:** ${card.keywords.join(', ')}\n\n`; }); interpretation += '\n## Overall Interpretation:\n\n'; interpretation += this.generateOverallInterpretation(reading, spread); return interpretation; } - src/tools/tarot-tools.ts:84-142 (helper)Private helper method that generates an overall interpretation by analyzing Major Arcana presence, dominant suits, reversed card count, and spread-specific context (past-present-future, celtic-cross, relationship-spread).
private generateOverallInterpretation(reading: TarotReading, spread: TarotSpread): string { let interpretation = ''; // Analyze major arcana presence const majorCards = reading.cards.filter(dc => dc.card.arcana === 'major'); if (majorCards.length > 0) { interpretation += `This reading contains ${majorCards.length} Major Arcana card${majorCards.length > 1 ? 's' : ''}, indicating significant life themes and spiritual lessons at play. `; } // Analyze suits for minor arcana const suits = { wands: 0, cups: 0, swords: 0, pentacles: 0 }; reading.cards.forEach(dc => { if (dc.card.suit) { suits[dc.card.suit]++; } }); const dominantSuits = Object.entries(suits) .filter(([_, count]) => count > 1) .sort((a, b) => b[1] - a[1]); if (dominantSuits.length > 0) { const [suit, count] = dominantSuits[0]; interpretation += `\n\nThe presence of ${count} ${suit} cards suggests a focus on `; switch(suit) { case 'wands': interpretation += 'creativity, passion, and action. '; break; case 'cups': interpretation += 'emotions, relationships, and intuition. '; break; case 'swords': interpretation += 'thoughts, communication, and challenges. '; break; case 'pentacles': interpretation += 'material matters, work, and practical concerns. '; break; } } // Analyze reversed cards const reversedCount = reading.cards.filter(dc => dc.isReversed).length; if (reversedCount > reading.cards.length / 2) { interpretation += `\n\nWith ${reversedCount} reversed cards, there may be internal blocks, delays, or a need for inner reflection before external action. `; } // Add spread-specific interpretation if (spread.id === 'past-present-future') { interpretation += '\n\nThis temporal reading shows the evolution of your situation from past influences through current circumstances to likely future outcomes. '; } else if (spread.id === 'celtic-cross') { interpretation += '\n\nThis comprehensive Celtic Cross reading provides deep insight into your situation, revealing both conscious and unconscious factors, as well as internal and external influences shaping your path forward. '; } else if (spread.id === 'relationship-spread') { interpretation += '\n\nThis relationship reading reveals the dynamics between you and another, highlighting both challenges to address and strengths to build upon. '; } interpretation += '\n\nRemember that tarot provides guidance and insight, but you always have the power to shape your own destiny through your choices and actions.'; return interpretation; } - src/index.ts:62-75 (schema)Tool definition with input schema for 'interpret_reading': takes a 'reading' object (required) from perform_reading output.
{ 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'], }, }, - src/index.ts:199-210 (registration)Handler in the CallToolRequestSchema switch-case that extracts the reading from args and calls tarotTools.interpretReading(reading).
case 'interpret_reading': { const reading = args.reading as any; const interpretation = tarotTools.interpretReading(reading); return { content: [ { type: 'text', text: interpretation, }, ], }; } - src/types/tarot.ts:15-22 (helper)The TarotReading interface defines the shape of the reading object consumed by interpretReading.
export interface TarotReading { id: string; timestamp: Date; spread: string; question?: string; cards: DrawCard[]; interpretation?: string; }