Skip to main content
Glama
gregario

lorcana-oracle

Character Versions

character_versions

Retrieve all printings and versions of any Disney Lorcana character across different sets to compare variations.

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 async handler function passed to server.registerTool for 'character_versions'. It calls getCardsByCharacterName, groups results by version, and returns formatted text 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() }],
      };
    },
  • Input schema for the 'character_versions' tool, defining the 'character_name' parameter with a Zod string description.
    inputSchema: {
      character_name: z.string().describe('Character base name (e.g. "Elsa", "Mickey Mouse")'),
    },
  • The registerCharacterVersions function that calls server.registerTool with the name 'character_versions', schema, and handler.
    export function registerCharacterVersions(server: McpServer, db: Database.Database): void {
      server.registerTool(
        'character_versions',
        {
          title: 'Character Versions',
          description:
            'Show all printings/versions of a Disney Lorcana character across sets. Useful for comparing different versions of the same character.',
          inputSchema: {
            character_name: z.string().describe('Character base name (e.g. "Elsa", "Mickey Mouse")'),
          },
        },
        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() }],
          };
        },
      );
    }
  • src/server.ts:45-49 (registration)
    Registration call in src/server.ts that invokes registerCharacterVersions(server, db) to attach the tool to the MCP server.
    registerCharacterVersions(server, db);
    registerBrowseFranchise(server, db);
    registerAnalyzeInkCurve(server, db);
    registerAnalyzeLore(server, db);
    registerFindSongSynergies(server, db);
  • Helper function formatVersionCard that formats a single CardRow into a readable text block with name, rarity, set, ink, cost, stats, and text.
    function formatVersionCard(card: CardRow): string {
      const lines: string[] = [];
      lines.push(`**${card.full_name ?? card.name}**`);
      lines.push(`  Rarity: ${card.rarity ?? '—'} | Set: ${card.set_code ?? '—'}`);
      lines.push(`  Ink: ${card.color} | Cost: ${card.cost ?? '—'} | Inkwell: ${card.inkwell ? 'Yes' : 'No'}`);
      if (card.type === 'Character') {
        lines.push(`  Strength: ${card.strength ?? '—'} | Willpower: ${card.willpower ?? '—'} | Lore: ${card.lore ?? '—'}`);
      }
      if (card.full_text) {
        lines.push(`  Text: ${card.full_text}`);
      }
      return lines.join('\n');
    }
Behavior3/5

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

No annotations provided, so the description carries the burden. It states the tool shows versions but does not discuss output format, error handling, or potential side effects. Adequate for a simple query tool.

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

Conciseness5/5

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

Two concise sentences: first explains function, second provides usage context. No unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with one parameter and no output schema, the description adequately conveys purpose and usage. Could mention output format but not essential.

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?

100% schema coverage with a clear parameter description. The description adds minimal extra meaning beyond the schema, just a usage note. Baseline 3 is appropriate.

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 states the tool's action ('show all printings/versions') and resource ('Disney Lorcana character across sets'), distinguishing it from sibling tools like search_cards or browse_sets.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides a clear use case ('useful for comparing different versions'), but does not explicitly state when not to use it or mention alternatives.

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

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