Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
ANKI_CONNECT_HOSTNoThe host for AnkiConnectlocalhost
ANKI_CONNECT_PORTNoThe port for AnkiConnect8765

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}
prompts
{
  "listChanged": true
}
resources
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
manage_flashcardsA

Create, search, inspect, edit, tag and delete Anki notes (flashcards) in the local collection via AnkiConnect. Use this for card content; use manage_decks for deck structure/limits, manage_models for note-type fields and templates, and manage_scheduling for review state (due cards, answering, suspend/unsuspend). For guidance on writing effective cards, use the "writing_good_flashcards" prompt.

Operations (set operation, then the listed parameters):

  • create: add one note. Needs deckName, modelName, fields; optional tags, allowDuplicate, duplicateScope. Writes immediately.

  • create_batch: add many notes. Give notes inline OR filePath to a .json (array of notes), .csv or .tsv file (header row = field names; optional tags, deck, model columns). Top-level deckName/modelName act as defaults that each note can override; top-level tags are added to every note. Notes are validated first (note type exists, field names match, duplicates, empty first field: each failure gets a reason), then sent sequentially in chunks of chunkSize (default 10). The result maps every note (#n plus the first ~40 chars of its first field) to its new note ID or failure reason. If Anki stops responding partway, it stops and lists which notes were saved and which to resend. Use dryRun: true to validate without writing. Prefer filePath for large imports: it keeps card text out of the conversation.

  • update: change fields and/or replace tags of one note. Needs noteId plus fields and/or tags.

  • delete: permanently delete notes and all their cards. Needs noteIds. Cannot be undone.

  • find: read-only; which notes match a search (listed), or how many by tag/deck/model/state (groupBy). Needs query (Anki search syntax). Output is compact: a header with the total match count and next offset, then one line per note. Optional:

    • include: what each note carries. Default ["fields"] (field text, HTML stripped, each field cut to maxFieldChars, default 120; 0 = no limit). Add "tags", "deck", "model", "cards" (card IDs) or "state" (per card: new/learning/review/relearning/suspended/buried, interval, due date, reps, lapses, ease). [] returns IDs only. includeDetails: true = all of them.

    • groupBy: counts over ALL matches (ignores limit). "tag" | "deck" | "model" give {notes, cards, new, seen} per group; "state" gives card/note counts per queue. Use it for "how many cards per topic" or "how much of this deck have I seen"; for today's due counts per deck, use manage_decks get_stats.

    • limit (default 50), offset, format ("lines" default, or "json" for single-line JSON). Listings are capped at ~20k chars: past that you get the first notes that fit plus a hint to use groupBy, include or a narrower query/limit. Search power-ups: deck:"Interview prep", tag:verbs, is:new, is:due, is:suspended, rated:2:1 (answered Again in the last 2 days; the go-to for "what am I failing"), rated:7 (reviewed in the last 7 days), prop:ivl>=21 (mature), prop:lapses>=3 (leeches), added:7, "front:word". Combine with spaces (AND), "or", and "-" for NOT.

  • get_info: read-only card details. Needs cardIds (max 50).

  • add_tags / remove_tags: needs tags plus noteIds OR query (Anki search; the server finds the notes, any number). dryRun: true reports the match count and sample IDs without writing.

  • clear_empty: deletes every note with empty cards in the whole collection.

Fails with a clear message if Anki isn't running.

manage_schedulingA

Run a quiz and change review state (answer, suspend, unsuspend, reset, relearn, reposition new cards) in the local Anki collection. Use this to get due card IDs and act on them; use manage_decks get_stats for due counts, get_analytics for progress and history, and manage_flashcards to edit card content.

Operations:

  • find_due: read-only; the IDs of matching cards due now, for running a quiz (not counts). Needs query (Anki search syntax, e.g. "deck:Spanish").

  • check_status: read-only. Needs cardIds; returns due/suspended flags per card.

  • answer: records reviews, as if answered in Anki. Needs answers: [{ cardId, ease }] where ease 1=Again, 2=Hard, 3=Good, 4=Easy. Affects future scheduling.

  • suspend / unsuspend: needs cardIds OR query. Suspended cards are excluded from reviews until unsuspended (e.g. pause a whole deck: query 'deck:"Spanish"').

  • forget: needs cardIds OR query. Resets cards to new, discarding their review progress (destructive).

  • relearn: needs cardIds OR query. Puts cards back into relearning.

  • reposition: sets the order new cards are introduced. Needs cardIds (in the order you want; e.g. interleave topics or put exam topics first) OR query (keeps their current relative order). Card i gets position start + i*step; start defaults to the front of the affected decks' new queue, step to 1. shift: true pushes other new cards down to make room. Cards that aren't new (or sit in a filtered deck) are skipped and listed, never rescheduled. Changes sync. Positions only matter when the deck gathers new cards by "deck" or "ascending_position" (see manage_decks set_display_order); the reply warns otherwise. Check the result with manage_flashcards find include ["state"] (#n = position). With query (Anki search syntax), the server finds the cards and applies the change in chunks, so thousands of cards take one call; it returns the count. dryRun: true returns the match count and sample IDs (for reposition, each card's planned position) without writing. A query matching nothing changes nothing.

All writes apply immediately and are not undoable through this tool.

manage_decksA

Create, list, inspect, configure, rename and delete Anki decks, and move cards between them. Use this for deck organization and per-deck daily limits; use manage_flashcards for card content. To suspend/unsuspend cards (e.g. pause a deck), use manage_scheduling.

Operations:

  • list: read-only; all deck names and IDs.

  • create: needs deckName (use "Parent::Child" for subdecks). Optional newPerDay and/or reviewsPerDay give the new deck its own daily limits (see set_limits). Does nothing if the deck already exists.

  • set_limits: needs deckName plus newPerDay and/or reviewsPerDay. Changes daily limits for this deck only: if the deck uses a shared options preset (e.g. "Default"), the preset is cloned into a new preset named after the deck, assigned to the deck, and only the clone is changed. Other decks are never affected. Cloned presets stay in Anki; deleting one later (in Anki's Deck Options) forces a full sync.

  • get_stats: read-only; today's due counts per deck ("what's due today?"). deckName (one deck) or deckNames (array). One line per deck: total cards and new/learning/review due today. Unknown names are reported, never created. For progress over time, use get_analytics deck_overview; for counts by tag or state, manage_flashcards find with groupBy.

  • get_config: read-only; needs deckName. Readable summary of the deck's options preset: name/ID and which other decks share it, daily limits, learning/relearning steps, leeches, burying, max interval, FSRS desired retention, and display order as named values. raw: true returns the full preset JSON instead (FSRS parameters included).

  • set_display_order: needs deckName plus any of newGatherOrder (deck, deck_then_random_notes, ascending_position, descending_position, random_notes, random_cards), newSortOrder (card_type_then_gathered, gathered, card_type_then_random, random_note_then_card_type, random), reviewOrder (due_date_then_random, due_date_then_deck, deck_then_due_date, ascending/descending_intervals, ascending/descending_ease, ascending/descending_retrievability, relative_overdueness, random, order_added, reverse_order_added), newReviewMix and interdayLearningMix (mix_with_reviews, after_reviews, before_reviews). Same shared-preset safety as set_limits; reports each change as old → new. For random new cards, set newGatherOrder random_notes (newSortOrder random only shuffles the cards already gathered). Anki uses the display order of the deck you study, not its subdecks'.

  • set_config: needs deckNames and configId; assigns an existing options preset to the decks.

  • rename: needs deckName and newName. Subdecks follow; cards keep their scheduling and each deck keeps its options preset. Refuses if newName already exists with cards. Anki's "studied today" counters start fresh for the renamed deck.

  • move_cards: needs targetDeck plus cardIds OR query (Anki search, e.g. 'deck:"Old" tag:x'; any number of cards). Reports the count and source decks. dryRun: true reports what would move without moving (only move_cards takes dryRun).

  • delete: needs deckNames. Permanently deletes the decks AND all their cards (deleteCards must not be false; AnkiConnect always deletes cards) and reports how many cards each held. Deleting a filtered deck returns its cards to their home decks instead. requireEmpty: true refuses if any deck has cards that would be deleted. Cannot be undone.

get_analyticsA

Read-only progress and review history from the local Anki collection ("how am I doing?", "what am I failing?", "how much have I studied?"), aggregated server-side into compact JSON or one line per row. For today's due counts per deck use manage_decks get_stats; for due card IDs, manage_scheduling find_due. To act on the findings, use manage_scheduling or manage_flashcards.

Scopes (set scope, then the listed parameters). deckName always includes subdecks; where optional, omitting it means the whole collection:

  • deck_overview: progress and health of one deck ("how am I doing on this deck?"). Needs deckName; optional days (default 30), limit (top tags, default 10). Returns new/learning/review/suspended and seen/unseen counts, the preset's new/day and reviews/day limits, the date the unseen cards run out at the new/day limit, reviews, correct % and retention over the window, and top tags by Again count.

  • collection_stats: the whole collection (or one deck subtree) at a glance, with the upcoming review forecast. Optional deckName, days (forecast length, default 14). Studied today (cards, minutes, again, correct %), card counts (new/learning/young/mature/suspended; mature = interval >= 21d), correct % by card type over the last 30 days, due-review forecast per day before limits (overdue backlog separate from today), shownToday (what Anki's deck list shows today after daily limits: new/learning/review for each top-level deck, or the deck and its direct subdecks), average/longest interval.

  • reviews_by_day: study volume per day. Optional deckName, days (default 30) or since (YYYY-MM-DD). One "YYYY-MM-DD: n" line per day (zero days included) plus a total.

  • trouble_cards: what you are failing. Optional deckName, days (default 7), limit (default 10). Cards answered Again in the window, grouped by tag, plus the worst cards (cardId, front text, again count, lapses).

  • reviews_today: the number of reviews done today across all decks.

  • card_reviews: raw review log of one deck (not subdecks), one line per review. Needs deckName and startTimestamp (epoch ms). Over limit (default 300) rows it returns a summary and how to narrow.

  • card_details: ease factor and current interval per card. Needs cardIds.

For "what am I failing", trouble_cards gives the aggregate; to get the cards themselves use manage_flashcards find with Anki search syntax, e.g. "rated:2:1" (answered Again in the last 2 days), "deck:Spanish rated:7:1", "prop:lapses>3" or "is:due".

manage_modelsA

List and modify Anki note types (models): fields, card templates and CSS. Use list before creating notes to find a note type's exact field names (e.g. "Front"/"Back"); use manage_flashcards for note content.

Operations:

  • list: read-only; every note type with its ID and ordered field names.

  • create: needs modelName, fields (ordered names) and templates ([{ Front, Back }]); optional css, isCloze.

  • add_field: needs modelName, fieldName, fieldIndex.

  • remove_field: needs modelName, fieldName. Deletes that field's content from every note of this type (destructive).

  • rename_field: needs modelName, fieldName, newFieldName.

  • add_template: needs modelName, template ({ Front, Back }). Generates new cards for existing notes.

  • remove_template: needs modelName, templateName. Deletes the cards generated by that template (destructive).

  • update_styling: needs modelName, css. Replaces the note type's CSS.

All operations except list change the collection immediately and affect every note of that type.

manage_collectionA

Collection maintenance for the Anki app: AnkiWeb sync, version check, .apkg import/export, profiles, and media files. Use this for maintenance tasks that are not about card content, decks, note types or reviews. To read a media file's contents (e.g. view an image), use get_media_file.

Operations:

  • version: read-only; AnkiConnect version (also a quick "is Anki running?" check).

  • get_profiles: read-only; profile names.

  • sync: syncs the collection with AnkiWeb (network; may upload or download changes).

  • export_deck: needs deckName and filePath (.apkg path to write); optional includeSched. Writes a file on disk.

  • import_package: needs filePath to an .apkg; adds its contents to the collection.

  • list_media: read-only; needs pattern (e.g. ".png", "").

  • retrieve_media: read-only; needs filename; reports whether it exists and its size.

  • store_media: needs filename plus mediaData (base64) or mediaUrl (downloaded by Anki). Overwrites a file with the same name.

  • delete_media: needs filename. Deletes the file from the media folder.

get_media_fileA

Read one file from Anki's media folder and return it as base64; images are also returned as image content the model can look at. Read-only. Use this when you need a referenced image/audio file's actual contents; use manage_collection list_media to find file names and store_media/delete_media to change files. Pass the bare filename as it appears in the card (e.g. "diagram.png"); paths and ".." are rejected. Returns an error object if the file doesn't exist.

control_guiA

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.

Prompts

Interactive templates invoked by user choice

NameDescription
writing_good_flashcardsGuidelines for writing effective spaced-repetition cards (minimum information principle, one fact per card, no yes/no questions, multiple angles, only understood material), based on Matuschak and SuperMemo. Use before creating cards with manage_flashcards.

Resources

Contextual data attached and managed by the client

NameDescription
deck_namesNames of all decks in the collection.
deck_names_and_idsMap of every deck name to its deck ID.
note_tagsEvery tag used in the collection.
model_namesNames of all note types (models).
model_names_and_idsMap of every note type name to its model ID.
cards_reviewed_by_dayNumber of cards reviewed on each day, as [date, count] pairs.
cards_reviewed_todayNumber of cards reviewed today.

TDQS

A4.5/5.0

Scored across 8 tools

Disambiguation4/5

The eight tools map to mostly distinct Anki subsystems: cards, decks, models, scheduling, analytics, collection maintenance, media reading, and GUI control. Some overlap remains between analytics/counting paths (get_analytics, manage_decks get_stats, manage_flashcards find/groupBy, manage_scheduling find_due) and media inspection (retrieve_media vs get_media_file), but the descriptions explicitly route between them.

Naming Consistency4/5

All names are snake_case and semantically predictable, with manage_<domain> used for the main write-oriented domains and get_/control_ for read-only or UI tools. The pattern is not a single strict verb_noun format across every tool, but it is consistent enough for an agent to infer purpose.

Tool Count5/5

Eight top-level tools is well within a reasonable range for a broad Anki server, and each tool corresponds to a coherent subsystem rather than being redundant. The heavy multiplexing happens inside tools via operations, but the top-level count itself is appropriately scoped.

Completeness4/5

Coverage is strong: notes and tags, decks and limits, note types, review state, analytics, sync/import/export, media, and GUI control are all represented. Minor gaps exist, such as no explicit delete_model or update_template operation for existing note-type templates, but most lifecycle needs are covered or have workarounds.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues