Skip to main content
Glama

Control the Anki app UI

anki_gui
Destructive

Open 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

NameRequiredDescriptionDefault
easeNoReview grade: 1 Again, 2 Hard, 3 Good, 4 Easy. Required for answer_card.
tagsNoTags to pre-fill. Optional for add_cards.
queryNoAnki search query (https://docs.ankiweb.net/searching.html), e.g. "deck:Spanish is:due". Required for browse.
cardIdNoCard ID. Required for select_card.
fieldsNoField name to value map used to pre-fill the note, e.g. {"Front": "...", "Back": "..."}. Required for add_cards.
noteIdNoNote ID. Required for edit_note; select_note passes it on as a card ID.
deckNameNoDeck name. Required for add_cards, deck_overview and deck_review.
filePathNoAbsolute path of the file to import (.apkg, .colpkg, .txt, .csv, ...). Required for import_file.
modelNameNoNote type (model) name, e.g. "Basic". Required for add_cards.
operationYesThe GUI action to perform. See the tool description for what each one does.
reorderCardsNoOptional sort order for the Card Browser. Used by browse.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.7.0

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only give blanket readOnly=false / destructive=true; the description goes far beyond that by naming which two operations are actually read-only, stating that `answer_card` records a review and reschedules, that `undo` reverts the user's last action, that `exit_anki` kills AnkiConnect too, and that `add_cards`/`edit_note`/`import_file` only open pre-filled dialogs with nothing saved until the user confirms. It also discloses that `check_database` returns before finishing.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is long, but front-loaded with purpose and side effects before the operation catalog, and the per-operation bullet list is scannable. Some lines duplicate schema-level requiredness information, which is mild redundancy rather than waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 18-operation tool with no output schema, the definition covers side effects, prerequisites, and return values for the key operations (`add_cards` returns the note ID, `browse` returns matching card IDs). Return values for smaller operations like `select_card`, `edit_note`, and `deck_browser` are not described, a minor gap given there is no output schema to fall back on.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 100%, so the bar is high. The description still adds value by mapping each operation to the parameters it consumes and by flagging quirks the schema cannot express, notably that `select_note`'s noteId is treated as a card ID by AnkiConnect and that `answer_card` requires the answer to be showing. Much of the operation-to-parameter mapping restates the schema's 'Required for X' notes, which caps it below 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource ('Drive the Anki desktop application's user interface') and then enumerates all 18 GUI operations by name. It explicitly distinguishes itself from the headless path by naming `manage_flashcards` as the alternative, so an agent can route correctly without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It states the selection condition plainly: use this when the user wants to see or act on something inside the Anki app itself, otherwise use `manage_flashcards` for headless reads/writes, which are faster and don't disturb windows. It also gives a targeted exclusion for `exit_anki` ('only use it when the user explicitly asks') and prerequisites ('Requires Anki to be running with the AnkiConnect add-on').

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.