getReviewQueue
Retrieve Anki flashcards due for review with options to filter by deck, card type, and quantity.
Instructions
Get cards due for review with filtering options
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| deckId | No | Optional deck ID to filter cards | |
| includeLearning | No | Include learning cards | |
| includeNew | No | Include new cards | |
| includeReview | No | Include review cards | |
| limit | No | Maximum number of cards to return |
Implementation Reference
- src/index.ts:226-248 (handler)The handler function for the getReviewQueue tool. It constructs query parameters from input args and makes a GET request to the Anki API endpoint '/api/v1/study/queue' to fetch cards due for review, returning the JSON response or an error message.execute: async args => { try { const queryParams: Record<string, boolean | number | string> = {}; if (args.deckId !== undefined) queryParams.deckId = args.deckId; if (args.includeLearning !== undefined) queryParams.includeLearning = args.includeLearning; if (args.includeNew !== undefined) queryParams.includeNew = args.includeNew; if (args.includeReview !== undefined) queryParams.includeReview = args.includeReview; if (args.limit !== undefined) queryParams.limit = args.limit; const data = await ankiApiRequest( 'GET', '/api/v1/study/queue', undefined, queryParams, ); return JSON.stringify(data, null, 2); } catch (error) { return `Error: ${error instanceof Error ? error.message : String(error)}`; } },
- src/index.ts:250-256 (schema)Zod schema defining the optional input parameters for the getReviewQueue tool: deckId, includeLearning, includeNew, includeReview, and limit.parameters: z.object({ deckId: z.string().optional().describe('Optional deck ID to filter cards'), includeLearning: z.boolean().optional().describe('Include learning cards'), includeNew: z.boolean().optional().describe('Include new cards'), includeReview: z.boolean().optional().describe('Include review cards'), limit: z.number().optional().describe('Maximum number of cards to return'), }),
- src/index.ts:224-257 (registration)The server.addTool call that registers the getReviewQueue tool, including its name, description, handler, and parameters schema.server.addTool({ description: 'Get cards due for review with filtering options', execute: async args => { try { const queryParams: Record<string, boolean | number | string> = {}; if (args.deckId !== undefined) queryParams.deckId = args.deckId; if (args.includeLearning !== undefined) queryParams.includeLearning = args.includeLearning; if (args.includeNew !== undefined) queryParams.includeNew = args.includeNew; if (args.includeReview !== undefined) queryParams.includeReview = args.includeReview; if (args.limit !== undefined) queryParams.limit = args.limit; const data = await ankiApiRequest( 'GET', '/api/v1/study/queue', undefined, queryParams, ); return JSON.stringify(data, null, 2); } catch (error) { return `Error: ${error instanceof Error ? error.message : String(error)}`; } }, name: 'getReviewQueue', parameters: z.object({ deckId: z.string().optional().describe('Optional deck ID to filter cards'), includeLearning: z.boolean().optional().describe('Include learning cards'), includeNew: z.boolean().optional().describe('Include new cards'), includeReview: z.boolean().optional().describe('Include review cards'), limit: z.number().optional().describe('Maximum number of cards to return'), }), });