get_cards_mod_time
Retrieve the modification timestamps for specified card IDs in Anki MCP. Use this tool to track changes and manage card updates efficiently.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cardIds | Yes | Array of card IDs to get modification time for |
Implementation Reference
- src/tools/cards.ts:412-435 (registration)Registers the 'get_cards_mod_time' tool with the MCP server, including inline schema and handler.// Tool: Get modification time for cards server.tool( 'get_cards_mod_time', { cardIds: z.array(z.number()).describe('Array of card IDs to get modification time for'), }, async ({ cardIds }) => { try { const modTimes = await ankiClient.card.cardsModTime({ cards: cardIds }); return { content: [ { type: 'text', text: `Modification times: ${JSON.stringify(modTimes, null, 2)}`, }, ], }; } catch (error) { throw new Error( `Failed to get modification times: ${error instanceof Error ? error.message : String(error)}` ); } } );
- src/tools/cards.ts:418-434 (handler)Handler function executes the tool: fetches modification times via ankiClient.card.cardsModTime and returns formatted text response.async ({ cardIds }) => { try { const modTimes = await ankiClient.card.cardsModTime({ cards: cardIds }); return { content: [ { type: 'text', text: `Modification times: ${JSON.stringify(modTimes, null, 2)}`, }, ], }; } catch (error) { throw new Error( `Failed to get modification times: ${error instanceof Error ? error.message : String(error)}` ); } }
- src/tools/cards.ts:415-417 (schema)Zod input schema for the tool: requires 'cardIds' as an array of numbers.{ cardIds: z.array(z.number()).describe('Array of card IDs to get modification time for'), },