gui_select_card
Select a specific card by its ID in the Anki MCP server to streamline card management and ensure precise targeting for study or modification tasks.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cardId | Yes | ID of the card to select |
Implementation Reference
- src/tools/graphical.ts:292-313 (registration)Registration of the 'gui_select_card' tool, including input schema (cardId: number) and handler function that delegates to ankiClient.graphical.guiSelectCard and returns success message.'gui_select_card', { cardId: z.number().describe('ID of the card to select'), }, async ({ cardId }) => { try { const result = await ankiClient.graphical.guiSelectCard({ card: cardId }); return { content: [ { type: 'text', text: `Successfully selected card ${cardId}. Result: ${result}`, }, ], }; } catch (error) { throw new Error( `Failed to select card: ${error instanceof Error ? error.message : String(error)}` ); } } );
- src/tools/graphical.ts:297-313 (handler)The core handler logic for executing the gui_select_card tool: calls Anki graphical API to select card by ID.try { const result = await ankiClient.graphical.guiSelectCard({ card: cardId }); return { content: [ { type: 'text', text: `Successfully selected card ${cardId}. Result: ${result}`, }, ], }; } catch (error) { throw new Error( `Failed to select card: ${error instanceof Error ? error.message : String(error)}` ); } } );
- src/tools/graphical.ts:294-295 (schema)Input schema validation using Zod: requires cardId as number.cardId: z.number().describe('ID of the card to select'), },
- src/tools/miscellaneous.ts:271-271 (helper)Reference to 'guiSelectCard' action in the multi-action tool's enum, allowing batch execution including this graphical action.'guiSelectCard',