csb_card
Fetch Commander Spellbook card data using numeric ID to access specific card information for Magic: The Gathering gameplay and strategy.
Instructions
Fetch Commander Spellbook card by numeric ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
Implementation Reference
- src/mcp-server.ts:481-492 (registration)Registration of the 'csb_card' MCP tool using server.registerTool, including schema and inline handler function.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/mcp-server.ts:480-480 (schema)Zod input schema definition for the csb_card tool: requires a positive integer 'id'.const csbCardInput = { id: z.number().int().positive() } as const;
- src/mcp-server.ts:488-491 (handler)Inline handler function for csb_card tool: calls CSB.getCard(id) and wraps result in structuredContent.async ({ id }: { id: number }) => { const res = await CSB.getCard(id); return { structuredContent: res } as any; }
- src/csb.ts:115-115 (helper)CSB.getCard helper: fetches card data from CSB API endpoint /cards/{id} using getJson utility.getCard: (id: number) => getJson(`/cards/${id}`),