Control the Anki app UI
anki_guiOpen Anki windows and dialogs, run on-screen review sessions, and read selected or visible cards in the desktop app. Use it when actions must happen inside Anki's interface.
Instructions
Drive the Anki desktop application's user interface: open windows and dialogs (Card Browser, Add Cards, Edit Note, deck overview, import), run an on-screen review session, and read what the user currently has selected or on screen. Use this when the user wants to see or act on something inside the Anki app itself; use manage_flashcards (and the other non-GUI tools) for headless reads and writes, which are faster and do not disturb the user's windows.
Side effects: every operation except current_card and selected_notes changes what is shown in Anki. answer_card records a review and reschedules the card. undo reverts the user's last action in Anki. exit_anki quits the Anki application (and AnkiConnect with it), so only use it when the user explicitly asks. add_cards, edit_note and import_file only open pre-filled dialogs; nothing is saved until the user confirms in Anki.
Operations and the parameters they use:
add_cards: open Add Cards pre-filled (deckName, modelName, fields, tags?); returns the note ID it would create.
browse: open the Card Browser with a search (query, reorderCards?); returns matching card IDs.
select_card: select a card in an open Card Browser (cardId).
select_note: legacy alias that also selects by card ID in the Card Browser (noteId, treated as a card ID by AnkiConnect).
selected_notes: read-only; note IDs selected in the Card Browser.
edit_note: open the Edit dialog for a note (noteId).
deck_browser: show the main deck list.
deck_overview: show a deck's overview screen (deckName).
deck_review: start reviewing a deck (deckName).
current_card: read-only; the card currently shown in the reviewer, or none.
show_question / show_answer: flip the current review card.
start_card_timer: restart the answer timer for the current card.
answer_card: grade the current card (ease 1-4); the answer must be showing.
undo: undo the last action in Anki.
check_database: start Tools > Check Database (returns before it finishes).
import_file: open the Import dialog for a file (filePath, forward slashes on Windows; Anki 2.1.52+).
exit_anki: gracefully close Anki.
Requires Anki to be running with the AnkiConnect add-on.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"operation": "<operation>"
},
"name": "anki_gui"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ease | No | Review grade: 1 Again, 2 Hard, 3 Good, 4 Easy. Required for answer_card. | |
| tags | No | Tags to pre-fill. Optional for add_cards. | |
| query | No | Anki search query (https://docs.ankiweb.net/searching.html), e.g. "deck:Spanish is:due". Required for browse. | |
| cardId | No | Card ID. Required for select_card. | |
| fields | No | Field name to value map used to pre-fill the note, e.g. {"Front": "...", "Back": "..."}. Required for add_cards. | |
| noteId | No | Note ID. Required for edit_note; select_note passes it on as a card ID. | |
| deckName | No | Deck name. Required for add_cards, deck_overview and deck_review. | |
| filePath | No | Absolute path of the file to import (.apkg, .colpkg, .txt, .csv, ...). Required for import_file. | |
| modelName | No | Note type (model) name, e.g. "Basic". Required for add_cards. | |
| operation | Yes | The GUI action to perform. See the tool description for what each one does. | |
| reorderCards | No | Optional sort order for the Card Browser. Used by browse. |