Skip to main content
Glama

Control the Anki app UI

control_gui
Destructive

Drive Anki's desktop interface to open dialogs, browse cards, start reviews, and read the selected notes or current card. Use it when actions must be visible in the Anki app rather than headless.

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": "control_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. Addedv2.0.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true, readOnlyHint=false and idempotentHint=false, so the safety profile is known; the description goes well beyond that by disclosing which two operations are non-mutating (`current_card`, `selected_notes`), that `answer_card` records a review and reschedules the card, that `undo` reverts the user's last action, and that `exit_anki` also kills AnkiConnect. It further clarifies the reassuring case that `add_cards`, `edit_note` and `import_file` only open pre-filled dialogs with nothing saved until the user confirms, and notes `check_database` returns before finishing — none of which is inferable from the annotations.

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?

The structure is strongly front-loaded: routing rule first, side effects second, the operation catalogue third, and the AnkiConnect prerequisite last. It is long, but nearly every line carries distinct information and the bulleted operation list is scannable; the minor cost is some repetition of required-parameter notes that the schema also states.

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

Completeness5/5

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

For an 11-parameter, nested-object, multi-operation dispatcher with no output schema, the description covers the routing decision, per-operation parameter usage, side effects, preconditions and return hints (note ID for add_cards, matching card IDs for browse). The environment prerequisite that Anki must be running with AnkiConnect is stated, leaving no material gap for correct invocation.

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 100%, so the baseline is 3, but the description adds a per-operation map showing which parameters each operation consumes (e.g. answer_card uses ease 1-4, browse uses query and optional reorderCards, select_note passes noteId as a card ID). It also adds operational context the schema lacks, such as forward slashes on Windows for filePath, the Anki 2.1.52+ version requirement for import, and the legacy-alias caveat on select_note.

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 opening sentence names a specific verb and resource ("Drive the Anki desktop application's user interface") and immediately scopes it to three concrete capability classes: opening windows/dialogs, running review sessions, and reading current selection or screen state. The enumerated operation list makes the covered surface unambiguous, and the explicit contrast with `manage_flashcards` lets an agent separate this from the headless siblings without opening a 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 supplies an explicit selection rule: use this when the user wants to see or act on something inside the Anki app, and use `manage_flashcards` or other non-GUI tools for headless reads/writes because they are faster and do not disturb the user's windows. It also adds a per-operation caution for `exit_anki` (only when the user explicitly asks) and a precondition that the answer must be showing before `answer_card`, so both when-to-use and when-not-to-use are covered.

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