get_card
Retrieve full card details including current prices, rarity, type, and flavor name for a specific Magic: The Gathering printing by set code and collector number.
Instructions
Look up a specific card printing by set code and collector number. Returns full card detail including current prices, rarity, type, and flavor name. For broader catalog search use search_cards.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| setCode | Yes | Set code (e.g. 'lea'). | |
| setNumber | Yes | Collector number within the set (e.g. '161'). String, not int - some sets use suffixes like '12a'. |
Implementation Reference
- src/tools/get-card.ts:15-21 (registration)The ToolDefinition object that registers 'get_card' with name, description, inputSchema, and handler.
export const getCardTool = { name: "get_card", description: "Look up a specific card printing by set code and collector number. Returns full card detail including current prices, rarity, type, and flavor name. For broader catalog search use search_cards.", inputSchema: z.object(getCardInputSchema), handler: getCard, }; - src/tools/get-card.ts:4-7 (schema)Input schema for get_card: requires setCode (string) and setNumber (string).
export const getCardInputSchema = { setCode: z.string().describe("Set code (e.g. 'lea')."), setNumber: z.string().describe("Collector number within the set (e.g. '161'). String, not int - some sets use suffixes like '12a'."), }; - src/tools/get-card.ts:9-13 (handler)The getCard async function that calls apiFetch with setCode and setNumber to look up a specific card printing.
export async function getCard(input: { setCode: string; setNumber: string }) { return apiFetch({ path: `/api/v1/cards/${encodeURIComponent(input.setCode)}/${encodeURIComponent(input.setNumber)}`, }); } - src/tools/index.ts:3-3 (registration)Import of getCardTool from get-card.ts into the central tools registration.
import { getCardTool, getCardPricesTool, getCardPriceHistoryTool } from "./get-card.js"; - src/tools/index.ts:51-51 (registration)getCardTool added to the central tools array for export.
getCardTool,