set_cards_due_date
Schedule or reschedule Anki cards by setting their due dates. Input card IDs and specify the number of days from today, including negative values for past dates, to organize study timelines effectively.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cardIds | Yes | Array of card IDs to set due date for | |
| days | Yes | Number of days from today (can be negative for past dates) |
Implementation Reference
- src/tools/cards.ts:292-308 (handler)Handler function that implements the 'set_cards_due_date' tool logic by calling ankiClient.card.setDueDate({ cards: cardIds, days }) and returning a success message or error.async ({ cardIds, days }) => { try { const result = await ankiClient.card.setDueDate({ cards: cardIds, days }); return { content: [ { type: 'text', text: `Successfully set due date for cards. Result: ${result}`, }, ], }; } catch (error) { throw new Error( `Failed to set due date for cards: ${error instanceof Error ? error.message : String(error)}` ); } }
- src/tools/cards.ts:288-291 (schema)Input schema for the 'set_cards_due_date' tool using Zod: cardIds (array of numbers) and days (string).{ cardIds: z.array(z.number()).describe('Array of card IDs to set due date for'), days: z.string().describe('Number of days from today (can be negative for past dates)'), },
- src/tools/cards.ts:286-309 (registration)Registration of the 'set_cards_due_date' tool via server.tool() call within registerCardTools function.server.tool( 'set_cards_due_date', { cardIds: z.array(z.number()).describe('Array of card IDs to set due date for'), days: z.string().describe('Number of days from today (can be negative for past dates)'), }, async ({ cardIds, days }) => { try { const result = await ankiClient.card.setDueDate({ cards: cardIds, days }); return { content: [ { type: 'text', text: `Successfully set due date for cards. Result: ${result}`, }, ], }; } catch (error) { throw new Error( `Failed to set due date for cards: ${error instanceof Error ? error.message : String(error)}` ); } } );