Skip to main content
Glama

list_sets

Retrieve a comprehensive list of all Magic: The Gathering card sets available through Scryfall's database for card collection management and set exploration.

Instructions

List all sets available on Scryfall.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Full registration block including the inline handler function that executes the list_sets tool logic by fetching sets via Scryfall.listSets() and returning formatted JSON.
    server.registerTool( "list_sets", { description: "List all sets available on Scryfall.", // No input schema for zero-arg tools } as any, async (): Promise<ToolResult> => { const data: unknown = await Scryfall.listSets(); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] } as any; } );
  • Scryfall API wrapper object defining listSets helper which calls getJson('/sets') to fetch the list of sets from Scryfall API.
    export const Scryfall = { searchCards: (opts: SearchParams) => getJson("/cards/search", opts), getCardById: (id: string) => getJson(`/cards/${encodeURIComponent(id)}`), getCardNamed: (name: string, fuzzy = false) => getJson("/cards/named", fuzzy ? { fuzzy: name } : { exact: name }), getRandomCard: (q?: string) => getJson("/cards/random", q ? { q } : undefined), autocomplete: (q: string) => getJson("/cards/autocomplete", { q }), listSets: () => getJson("/sets"), getRulingsById: (id: string) => getJson(`/cards/${encodeURIComponent(id)}/rulings`) };
  • Explicit registration of the 'list_sets' tool in the MCP server with description and inline handler.
    server.registerTool( "list_sets", { description: "List all sets available on Scryfall.", // No input schema for zero-arg tools } as any, async (): Promise<ToolResult> => { const data: unknown = await Scryfall.listSets(); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] } as any; } );

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/latte-chan/scryfall-connector'

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