search_cards
Find tarot cards by searching their names, keywords, and descriptions.
Instructions
Search for tarot cards by keyword
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query (searches names, keywords, and descriptions) |
Implementation Reference
- src/tools/tarot-tools.ts:169-176 (handler)The actual searchCards method on the TarotTools class. It filters allCards by matching the query against card name, keywords, and description.
searchCards(query: string): TarotCard[] { const lowerQuery = query.toLowerCase(); return allCards.filter(card => card.name.toLowerCase().includes(lowerQuery) || card.keywords.some(k => k.toLowerCase().includes(lowerQuery)) || card.description.toLowerCase().includes(lowerQuery) ); } - src/index.ts:120-133 (registration)The tool registration/schema definition for 'search_cards' in the TOOLS array, including its name, description, and inputSchema with a required 'query' string parameter.
{ 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'], }, }, - src/index.ts:277-293 (handler)The case handler in the CallToolRequestSchema switch that calls tarotTools.searchCards(query) and returns a mapped result.
case 'search_cards': { const query = args.query as string; const cards = tarotTools.searchCards(query); return { content: [ { type: 'text', text: JSON.stringify(cards.map(c => ({ name: c.name, arcana: c.arcana, keywords: c.keywords, id: c.id })), null, 2), }, ], }; } - src/types/tarot.ts:1-13 (schema)The TarotCard interface used as the return type for searchCards, defining fields like id, name, arcana, keywords, description, etc.
export interface TarotCard { id: string; name: string; arcana: 'major' | 'minor'; number?: number; suit?: 'wands' | 'cups' | 'swords' | 'pentacles'; keywords: string[]; uprightMeaning: string; reversedMeaning: string; description: string; element?: string; astrology?: string; }