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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp-server.ts:247-257 (handler)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; } );
- src/scryfall.ts:99-108 (helper)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`) };
- src/mcp-server.ts:247-257 (registration)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; } );