get_card_prices
Retrieve current normal and foil prices for a specific Magic: The Gathering card printing by providing set code and collector number.
Instructions
Get current normal and foil prices for a specific card printing.
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:23-31 (handler)The getCardPricesTool object defines the 'get_card_prices' tool with its name, description, inputSchema, and async handler. The handler calls apiFetch to GET /api/v1/cards/{setCode}/{setNumber}/prices.
export const getCardPricesTool = { name: "get_card_prices", description: "Get current normal and foil prices for a specific card printing.", inputSchema: z.object(getCardInputSchema), handler: async (input: { setCode: string; setNumber: string }) => apiFetch({ path: `/api/v1/cards/${encodeURIComponent(input.setCode)}/${encodeURIComponent(input.setNumber)}/prices`, }), }; - src/tools/get-card.ts:4-7 (schema)The shared getCardInputSchema defines the two required inputs: setCode (string) and setNumber (string), used as the inputSchema for get_card_prices.
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/index.ts:48-53 (registration)The getCardPricesTool is added to the tools array, registering it as an available MCP tool alongside getCardTool and getCardPriceHistoryTool.
export const tools: ToolDefinition[] = [ // Read-only (no auth) searchCardsTool, getCardTool, getCardPricesTool, getCardPriceHistoryTool, - src/tools/index.ts:90-92 (registration)The toolsByName lookup map is built from the tools array, enabling dynamic dispatch by tool name in the server handler.
export const toolsByName: Record<string, ToolDefinition> = Object.fromEntries( tools.map((t) => [t.name, t]), );