Skip to main content
Glama
gregario

lorcana-oracle

Browse Sets

browse_sets

View all Disney Lorcana sets. Drill into a specific set by set code to see its metadata and cards.

Instructions

List all Disney Lorcana sets, or drill into a specific set to see its metadata and cards. Provide a set_code to see cards in that set.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
set_codeNoSet code to browse (e.g. "1", "2"). Omit to list all sets.

Implementation Reference

  • The main handler function 'registerBrowseSets' that registers the 'browse_sets' tool on the MCP server. It handles listing all sets (when no set_code provided) or drilling into a specific set to show its cards, with special handling for unreleased/preview sets.
    export function registerBrowseSets(server: McpServer, db: Database.Database): void {
      server.registerTool(
        'browse_sets',
        {
          title: 'Browse Sets',
          description:
            'List all Disney Lorcana sets, or drill into a specific set to see its metadata and cards. Provide a set_code to see cards in that set.',
          inputSchema: {
            set_code: z.string().optional().describe('Set code to browse (e.g. "1", "2"). Omit to list all sets.'),
          },
        },
        async (args) => {
          if (!args.set_code) {
            // List all sets
            const sets = listSets(db);
            if (sets.length === 0) {
              return {
                content: [{ type: 'text' as const, text: 'No sets found in the database.' }],
              };
            }
            const lines = sets.map(
              (s) =>
                `**${s.name}** (${s.code})\n  Type: ${s.type ?? '—'} | ${formatSetStatus(s)} | Released: ${s.release_date ?? '—'}`,
            );
            return {
              content: [
                {
                  type: 'text' as const,
                  text: `Found ${sets.length} sets:\n\n${lines.join('\n\n')}`,
                },
              ],
            };
          }
    
          // Browse specific set
          const set = getSet(db, args.set_code);
          if (!set) {
            const allSets = listSets(db);
            const codes = allSets.map((s) => s.code).join(', ');
            return {
              content: [
                {
                  type: 'text' as const,
                  text: `Set "${args.set_code}" not found. Available set codes: ${codes}`,
                },
              ],
              isError: true,
            };
          }
    
          const { rows } = getCardsBySet(db, args.set_code, 1000, 0);
          const header = [
            `**${set.name}** (${set.code})`,
            `Type: ${set.type ?? '—'} | ${formatSetStatus(set)} | Released: ${set.release_date ?? '—'}`,
          ];
    
          // Unreleased set with no cards yet: explain why instead of dumping an empty list.
          if (set.released === 0 && rows.length === 0) {
            const when = set.release_date
              ? `releases ${set.release_date}`
              : 'release date TBA';
            header.push(
              '',
              `This set has not yet been released (${when}). Card data will appear once it is published by the upstream data source (LorcanaJSON).`,
            );
            return {
              content: [
                {
                  type: 'text' as const,
                  text: header.join('\n'),
                },
              ],
            };
          }
    
          // Pre-release set with spoilers: show cards but flag as preview.
          if (set.released === 0) {
            const when = set.release_date
              ? `releases ${set.release_date}`
              : 'release date TBA';
            header.push(
              '',
              `Preview — this set has not yet released (${when}). The card list below reflects spoilers from the upstream data source and may be incomplete.`,
              '',
              `Cards in set (${rows.length}):`,
            );
          } else {
            header.push('', `Cards in set (${rows.length}):`);
          }
          const cardLines = rows.map(formatCardBrief);
    
          return {
            content: [
              {
                type: 'text' as const,
                text: header.join('\n') + '\n' + cardLines.join('\n'),
              },
            ],
          };
        },
      );
    }
  • src/server.ts:44-44 (registration)
    Registration call that connects the browse_sets tool to the MCP server via registerBrowseSets(server, db).
    registerBrowseSets(server, db);
  • Input schema definition for browse_sets: accepts an optional 'set_code' string parameter.
    {
      title: 'Browse Sets',
      description:
        'List all Disney Lorcana sets, or drill into a specific set to see its metadata and cards. Provide a set_code to see cards in that set.',
      inputSchema: {
        set_code: z.string().optional().describe('Set code to browse (e.g. "1", "2"). Omit to list all sets.'),
      },
  • Helper function 'formatCardBrief' that formats a single card row into a human-readable string for display.
    function formatCardBrief(card: CardRow): string {
      const stats: string[] = [];
      if (card.type === 'Character') {
        stats.push(`${card.strength ?? '—'}/${card.willpower ?? '—'}/${card.lore ?? '—'}`);
      } else if (card.type === 'Location' && card.lore !== null) {
        stats.push(`Lore: ${card.lore}`);
      }
      const statsStr = stats.length > 0 ? ` | ${stats.join(' ')}` : '';
      return `  #${card.number ?? '—'} ${card.full_name ?? card.name} — ${card.color} ${card.type} | Cost ${card.cost ?? '—'}${statsStr} | ${card.rarity ?? '—'}`;
    }
  • Helper function 'formatSetStatus' that renders the card count and release status of a set (released, preview, or unreleased).
    function formatSetStatus(set: { card_count: number; released: number; release_date: string | null }): string {
      if (set.released === 1) {
        return `Cards: ${set.card_count}`;
      }
      // Pre-release set — distinguish "we have spoilers" from "no data yet".
      const when = set.release_date
        ? `releases ${set.release_date}`
        : 'release date TBA';
      if (set.card_count > 0) {
        return `Cards: ${set.card_count} (preview — ${when})`;
      }
      return `Cards: 0 (set unreleased — ${when})`;
    }
Behavior3/5

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

No annotations are provided. The description implies a read-only operation (listing/drilling) but does not explicitly state behavioral traits such as read-only nature, authentication requirements, rate limits, or any side effects. For a tool with no annotations, more explicit behavioral context would be beneficial.

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?

The description is extremely concise with two sentences, front-loading the primary action. Every sentence provides necessary information without any fluff or redundancy.

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

Completeness5/5

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

Given the tool's simplicity (one optional parameter, no output schema, no annotations), the description adequately covers what the tool does and how to use it. It does not need to explain return values, as the behavior is straightforward.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with a single parameter set_code. The description adds value by explaining the two usage scenarios (omit vs. provide the code) and the effect of providing it (see cards in that set). This goes beyond the schema's simple description of the parameter.

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 action (list or drill) and resource (Disney Lorcana sets), and specifies the two distinct modes: listing all sets or showing a specific set's cards. It distinguishes itself from siblings like search_cards by focusing on sets rather than generic card search.

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 clear usage guidance: omit set_code for listing all sets, provide it to drill into a specific set. It implicitly guides when to use this tool over search_cards (which is for broader card search), but does not explicitly state when not to use it or list 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