csb_card
Fetch a Commander Spellbook card using its numeric ID to access specific card data from the Scryfall API for Magic: The Gathering.
Instructions
Fetch Commander Spellbook card by numeric ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
Implementation Reference
- src/mcp-server.ts:488-491 (handler)Handler function that calls CSB.getCard(id) and wraps the result in structuredContent.async ({ id }: { id: number }) => { const res = await CSB.getCard(id); return { structuredContent: res } as any; }
- src/mcp-server.ts:480-480 (schema)Input schema defining a positive integer 'id' parameter.const csbCardInput = { id: z.number().int().positive() } as const;
- src/mcp-server.ts:481-492 (registration)Registers the 'csb_card' tool with MCP server, including schema and handler.server.registerTool( "csb_card", { title: "CSB: Get card", description: "Fetch Commander Spellbook card by numeric ID.", inputSchema: csbCardInput }, async ({ id }: { id: number }) => { const res = await CSB.getCard(id); return { structuredContent: res } as any; } );
- src/csb.ts:115-115 (helper)CSB.getCard utility that fetches card data from Commander Spellbook API endpoint /cards/{id} via getJson helper.getCard: (id: number) => getJson(`/cards/${id}`),