get_cards_info
Retrieve detailed information for specific Anki cards by providing their unique IDs, enabling efficient data access and management.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cardIds | Yes | Array of card IDs to get information for |
Implementation Reference
- src/tools/cards.ts:80-96 (handler)Handler function that fetches detailed card information using ankiClient and returns it as JSON-formatted text content.try { const cardsInfo = await ankiClient.card.cardsInfo({ cards: cardIds }); return { content: [ { type: 'text', text: `Card information: ${JSON.stringify(cardsInfo, null, 2)}`, }, ], }; } catch (error) { throw new Error( `Failed to get cards info: ${error instanceof Error ? error.message : String(error)}` ); } } );
- src/tools/cards.ts:77-79 (schema)Zod input schema defining cardIds as an array of numbers.cardIds: z.array(z.number()).describe('Array of card IDs to get information for'), }, async ({ cardIds }) => {
- src/tools/cards.ts:75-97 (registration)Registration of the 'get_cards_info' MCP tool using server.tool, including schema and inline handler.'get_cards_info', { cardIds: z.array(z.number()).describe('Array of card IDs to get information for'), }, async ({ cardIds }) => { try { const cardsInfo = await ankiClient.card.cardsInfo({ cards: cardIds }); return { content: [ { type: 'text', text: `Card information: ${JSON.stringify(cardsInfo, null, 2)}`, }, ], }; } catch (error) { throw new Error( `Failed to get cards info: ${error instanceof Error ? error.message : String(error)}` ); } } );