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 study_session for review state (to suspend/unsuspend cards, use study_session). 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 search with Anki query syntax. Needs query. 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: "tag" | "deck" | "model" returns {notes, cards, new, seen} per group, and "state" returns card/note counts per queue, over ALL matches (ignores limit). Use this for "how many cards per topic" or "how much of this deck have I seen" instead of listing.

    • 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.

study_sessionA

Find due cards and change review state (answer, suspend, unsuspend, reset, relearn) in the local Anki collection. Use this to run a quiz or adjust scheduling; use manage_flashcards to edit card content and get_analytics for history and statistics.

Operations:

  • find_due: read-only. Needs query (Anki search syntax, e.g. "deck:Spanish"); returns which matching cards are due now.

  • 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. 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 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 study_session.

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; deckName (one deck) or deckNames (array). One line per deck: total cards and today's new/learning/review due counts. Unknown names are reported, never created. For counts by tag or state within a deck, use 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 study statistics and review history from the local Anki collection, aggregated server-side into compact JSON or one line per row. Use this for reporting and diagnosing progress; it never changes data. To act on the findings, use study_session or manage_flashcards.

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

  • deck_overview: needs deckName; optional days (default 30), limit (top tags, default 10). One-call answer to "how am I doing on this deck": 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: 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: 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: 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).

  • deck_stats: needs deckName; Anki's new/learning/review counts for the deck.

  • reviews_today: number of reviews today across all decks.

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

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

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.

anki_operationsA

Utility operations 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 anki_operations 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.

anki_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.6/5.0

Scored across 8 tools

Disambiguation4/5

Each tool owns a clear domain (card content, deck structure, note types, review state, analytics, GUI, app maintenance), and descriptions explicitly cross-reference boundaries (e.g. 'use study_session to suspend'). However, several read paths overlap heavily — manage_flashcards find with state/groupBy, study_session find_due, manage_decks get_stats, and get_analytics scopes can all answer 'what's due / how am I doing', which risks misselection despite the guidance.

Naming Consistency3/5

The manage_flashcards / manage_decks / manage_models trio follows a clean verb_noun pattern, and get_analytics/get_media_file fit it. But study_session, anki_operations, and anki_gui are noun-phrase names that break the convention, and the aggregate 'anki_operations' bucket is vague about its scope.

Tool Count5/5

Eight tools is well-scoped for an Anki integration, and each aggregates a coherent area via an operation parameter rather than exploding into dozens of single-action tools. Every tool earns its place in the surface.

Completeness5/5

Coverage is broad and lifecycle-complete: note CRUD plus batch import, deck CRUD and limits/config, note-type fields/templates/CSS, review answering/suspend/forget/relearn, analytics, media files, sync/import/export, and even GUI driving. Only niche gaps (e.g. tag renaming, own-write undo) remain.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues