list_sets
Retrieve a complete list of Magic: The Gathering card sets from Scryfall's database to browse available expansions and collections.
Instructions
List all sets available on Scryfall.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp-server.ts:253-256 (handler)The inline handler function for the 'list_sets' tool. It calls Scryfall.listSets() to fetch the data and returns it formatted as a ToolResult with JSON stringified text content.async (): Promise<ToolResult> => { const data: unknown = await Scryfall.listSets(); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] } as any; }
- src/mcp-server.ts:247-257 (registration)Registration of the 'list_sets' MCP tool using server.registerTool(). Includes tool name, description (no input schema since zero-arg), and the inline handler function.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:106-106 (helper)Helper method in the Scryfall API wrapper object that fetches the list of all sets from the Scryfall API endpoint "/sets" using getJson.listSets: () => getJson("/sets"),