relearn_cards
Reset and relearn specific cards in Anki by providing their IDs, helping users efficiently revisit and retain spaced-repetition material.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cardIds | Yes | Array of card IDs to relearn |
Implementation Reference
- src/tools/cards.ts:261-283 (registration)Full registration of the 'relearn_cards' MCP tool, including input schema validation and the handler function that executes ankiClient.card.relearnCards to set cards to relearn status.server.tool( 'relearn_cards', { cardIds: z.array(z.number()).describe('Array of card IDs to relearn'), }, async ({ cardIds }) => { try { await ankiClient.card.relearnCards({ cards: cardIds }); return { content: [ { type: 'text', text: `Successfully set ${cardIds.length} cards to relearn`, }, ], }; } catch (error) { throw new Error( `Failed to relearn cards: ${error instanceof Error ? error.message : String(error)}` ); } } );
- src/tools/cards.ts:266-283 (handler)Handler function for 'relearn_cards' tool: takes array of cardIds, calls ankiClient.card.relearnCards, returns success message or throws error.async ({ cardIds }) => { try { await ankiClient.card.relearnCards({ cards: cardIds }); return { content: [ { type: 'text', text: `Successfully set ${cardIds.length} cards to relearn`, }, ], }; } catch (error) { throw new Error( `Failed to relearn cards: ${error instanceof Error ? error.message : String(error)}` ); } } );
- src/tools/cards.ts:263-265 (schema)Input schema for 'relearn_cards' tool: requires array of numeric card IDs.{ cardIds: z.array(z.number()).describe('Array of card IDs to relearn'), },