insert_reviews
Add review data to Anki MCP by inserting arrays of review tuples, each containing timestamp, card ID, intervals, and review details for accurate tracking and analysis.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reviews | Yes | Array of review tuples to insert |
Implementation Reference
- src/tools/statistic.ts:184-200 (handler)The handler function for the 'insert_reviews' MCP tool. It takes an array of review tuples and inserts them into Anki via ankiClient.statistic.insertReviews, returning a success message.async ({ reviews }) => { try { await ankiClient.statistic.insertReviews({ reviews }); return { content: [ { type: 'text', text: `Successfully inserted ${reviews.length} reviews into the database`, }, ], }; } catch (error) { throw new Error( `Failed to insert reviews: ${error instanceof Error ? error.message : String(error)}` ); } }
- src/tools/statistic.ts:167-182 (schema)Input schema for the 'insert_reviews' tool using Zod. Defines 'reviews' as an array of 9-tuple numbers representing review data.{ reviews: z .array( z.tuple([ z.number().describe('Review time (unix timestamp)'), z.number().describe('Card ID'), z.number().describe('USN'), z.number().describe('Button pressed'), z.number().describe('New interval'), z.number().describe('Previous interval'), z.number().describe('New factor'), z.number().describe('Review duration'), z.number().describe('Review type'), ]) ) .describe('Array of review tuples to insert'),
- src/tools/statistic.ts:165-201 (registration)Registration of the 'insert_reviews' MCP tool using server.tool(), including the tool name, input schema, and handler function.server.tool( 'insert_reviews', { reviews: z .array( z.tuple([ z.number().describe('Review time (unix timestamp)'), z.number().describe('Card ID'), z.number().describe('USN'), z.number().describe('Button pressed'), z.number().describe('New interval'), z.number().describe('Previous interval'), z.number().describe('New factor'), z.number().describe('Review duration'), z.number().describe('Review type'), ]) ) .describe('Array of review tuples to insert'), }, async ({ reviews }) => { try { await ankiClient.statistic.insertReviews({ reviews }); return { content: [ { type: 'text', text: `Successfully inserted ${reviews.length} reviews into the database`, }, ], }; } catch (error) { throw new Error( `Failed to insert reviews: ${error instanceof Error ? error.message : String(error)}` ); } } );