Skip to main content
Glama
gregario

lorcana-oracle

character_versions

Find all printings and versions of Disney Lorcana characters across card sets to compare different iterations of the same character.

Instructions

Show all printings/versions of a Disney Lorcana character across sets. Useful for comparing different versions of the same character.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
character_nameYesCharacter base name (e.g. "Elsa", "Mickey Mouse")

Implementation Reference

  • The handler implementation for the 'character_versions' tool, which fetches cards by name, handles partial matches, and formats the output.
    async (args) => {
      const cards = getCardsByCharacterName(db, args.character_name);
    
      if (cards.length === 0) {
        // Try partial match suggestions
        const suggestions = db
          .prepare(
            'SELECT DISTINCT name FROM cards WHERE name LIKE @pattern LIMIT 5',
          )
          .all({ pattern: `%${args.character_name}%` }) as { name: string }[];
    
        let text = `No versions found for character "${args.character_name}".`;
        if (suggestions.length > 0) {
          text += `\n\nDid you mean one of these?\n${suggestions.map((s) => `  - ${s.name}`).join('\n')}`;
        }
    
        return {
          content: [{ type: 'text' as const, text }],
          isError: true,
        };
      }
    
      // Group by version
      const versionMap = new Map<string, CardRow[]>();
      for (const card of cards) {
        const version = card.version ?? card.full_name ?? card.name;
        const existing = versionMap.get(version) ?? [];
        existing.push(card);
        versionMap.set(version, existing);
      }
    
      const header = `**${args.character_name}** — ${versionMap.size} version${versionMap.size !== 1 ? 's' : ''}, ${cards.length} printing${cards.length !== 1 ? 's' : ''}`;
    
      const sections: string[] = [header, ''];
      for (const [, printings] of versionMap) {
        for (const card of printings) {
          sections.push(formatVersionCard(card));
          sections.push('');
        }
      }
    
      return {
        content: [{ type: 'text' as const, text: sections.join('\n').trimEnd() }],
      };
    },
  • The Zod schema defining the input for the 'character_versions' tool.
    inputSchema: {
      character_name: z.string().describe('Character base name (e.g. "Elsa", "Mickey Mouse")'),
    },
  • The tool name registration for the 'character_versions' tool.
    'character_versions',

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/gregario/lorcana-oracle'

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