search_tcgplayer
Find current trading card prices on TCGPlayer for Magic, Pokémon, Yu-Gi-Oh!, and other collectible card games. Get market prices, lowest listings, and card images to make informed purchasing decisions.
Instructions
Search trading card prices from TCGPlayer. Covers Magic the Gathering, Pokémon, Yu-Gi-Oh!, Lorcana, and more. Returns market prices, lowest prices, listing counts, and card images.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Card name or search term (e.g. "charizard", "black lotus") | |
| limit | No | Number of results to return (max 50) |
Implementation Reference
- src/index.ts:17-48 (handler)The 'search_tcgplayer' tool definition and handler implementation. It uses a Zod schema for input validation and fetches data from a backend service.
server.tool( "search_tcgplayer", "Search trading card prices from TCGPlayer. Covers Magic the Gathering, Pokémon, Yu-Gi-Oh!, Lorcana, and more. Returns market prices, lowest prices, listing counts, and card images.", { query: z .string() .describe('Card name or search term (e.g. "charizard", "black lotus")'), limit: z .number() .int() .min(1) .max(50) .default(20) .describe("Number of results to return (max 50)"), }, async ({ query, limit }) => { const url = `${BACKEND_URL}/tcgplayer/search?query=${encodeURIComponent(query)}&limit=${limit}`; const res = await fetch(url); const data = await res.json(); if (!data.success) { return { isError: true, content: [{ type: "text", text: `Error: ${data.error}` }], }; } return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }], }; } );