Skip to main content
Glama

Manage flashcards

manage_flashcards
Destructive

Create, search, inspect, edit, tag, and delete Anki notes (flashcards) in your local collection via AnkiConnect, including batch import and dry-run validation.

Instructions

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.

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": "manage_flashcards"
  }
}

Input Schema

NameRequiredDescriptionDefault
tagsNocreate: tags for the note. create_batch: added to every note. update: replaces the note's tags. add_tags/remove_tags: tags to add/remove
limitNofind: max notes per page (default 50)
notesNocreate_batch: notes to add (or use filePath instead)
queryNofind (and add_tags/remove_tags instead of noteIds): Anki search query, e.g. 'deck:"Spanish" tag:verbs', "is:new", "rated:2:1" (answered Again in the last 2 days), "prop:ivl>=21"
dryRunNocreate_batch: validate every note and report problems without writing anything. add_tags/remove_tags: report how many notes match (and sample IDs) without changing them. Rejected for other operations
fieldsNocreate/update: field name -> value (HTML allowed). Names must match the note type, e.g. { "Front": "...", "Back": "..." }
formatNofind: "lines" (default, one line per note/group) or compact single-line JSON
noteIdNoupdate: ID of the note to change
offsetNofind: notes to skip, for paging (default 0); use the returned next offset
cardIdsNoget_info: card IDs (max 50)
groupByNofind: return counts per tag/deck/model ({notes, cards, new, seen}) or per scheduling state, over ALL matches, instead of a listing
includeNofind: what each listed note carries (default ["fields"]; [] = IDs only). fields = field text (HTML stripped, truncated), tags, deck, model, state = per-card queue/interval/due/reps/lapses/ease, cards = card IDs
noteIdsNodelete/add_tags/remove_tags: note IDs to act on (add_tags/remove_tags: or use query)
deckNameNocreate: target deck (required). create_batch: default deck for notes without their own deckName
filePathNocreate_batch: absolute path to a .json (array of notes like `notes`), .csv or .tsv file. CSV/TSV: header row = field names, plus optional "tags" (space-separated), "deck" and "model" columns. Use instead of notes
chunkSizeNocreate_batch: notes per AnkiConnect request (default 10)
modelNameNocreate: note type (required), e.g. "Basic". create_batch: default note type for notes without their own. Use manage_models list for field names
operationYesWhich operation to run; see the tool description for required parameters
maxFieldCharsNofind: truncate each field to this many characters (default 120; 0 = no limit)
allowDuplicateNocreate/create_batch: add notes even if the first field duplicates an existing note (default false)
duplicateScopeNocreate/create_batch: where to look for duplicates: "collection" (default) or only the target "deck"
includeDetailsNofind: shorthand for include: all of fields, tags, deck, model, state, cards

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed16 schema fields changedv1.3.0
    • changedInput schema / properties / dryRun / description
      Previous value: -"create_batch: validate every note and report problems without writing anything"New value: +"create_batch: validate every note and report problems without writing anything. add_tags/remove_tags: report how many notes match (and sample IDs) without changing them. Rejected for other operations"
    • addedInput schema / properties / format
      Added value: +{
      +  "description": "find: \"lines\" (default, one line per note/group) or compact single-line JSON",
      +  "enum": [
      +    "lines",
      +    "json"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / groupBy
      Added value: +{
      +  "description": "find: return counts per tag/deck/model ({notes, cards, new, seen}) or per scheduling state, over ALL matches, instead of a listing",
      +  "enum": [
      +    "tag",
      +    "deck",
      +    "state",
      +    "model"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / include
      Added value: +{
      +  "description": "find: what each listed note carries (default [\"fields\"]; [] = IDs only). fields = field text (HTML stripped, truncated), tags, deck, model, state = per-card queue/interval/due/reps/lapses/ease, cards = card IDs",
      +  "items": {
      +    "enum": [
      +      "fields",
      +      "tags",
      +      "deck",
      +      "model",
      +      "state",
      +      "cards"
      +    ],
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedInput schema / properties / includeDetails / description
      Previous value: -"find: include full note fields/tags instead of only IDs (larger output)"New value: +"find: shorthand for include: all of fields, tags, deck, model, state, cards"
    • changedInput schema / properties / limit / description
      Previous value: -"find: max results per page (default 50)"New value: +"find: max notes per page (default 50)"
    • addedInput schema / properties / limit / maximum
      Added value: +9007199254740991
    • addedInput schema / properties / limit / minimum
      Added value: +1
    • changedInput schema / properties / limit / type
      Previous value: -"number"New value: +"integer"
    • addedInput schema / properties / maxFieldChars
      Added value: +{
      +  "description": "find: truncate each field to this many characters (default 120; 0 = no limit)",
      +  "maximum": 9007199254740991,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • changedInput schema / properties / noteIds / description
      Previous value: -"delete/add_tags/remove_tags: note IDs to act on"New value: +"delete/add_tags/remove_tags: note IDs to act on (add_tags/remove_tags: or use query)"
    • changedInput schema / properties / offset / description
      Previous value: -"find: results to skip, for paging (default 0)"New value: +"find: notes to skip, for paging (default 0); use the returned next offset"
    • addedInput schema / properties / offset / maximum
      Added value: +9007199254740991
    • addedInput schema / properties / offset / minimum
      Added value: +0
    • changedInput schema / properties / offset / type
      Previous value: -"number"New value: +"integer"
    • changedInput schema / properties / query / description
      Previous value: -"find: Anki search query, e.g. \"deck:Spanish tag:verbs added:7\""New value: +"find (and add_tags/remove_tags instead of noteIds): Anki search query, e.g. 'deck:\"Spanish\" tag:verbs', \"is:new\", \"rated:2:1\" (answered Again in the last 2 days), \"prop:ivl>=21\""
  2. Changed28 schema fields changedv0.7.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / allowDuplicate
      Added value: +{
      +  "description": "create/create_batch: add notes even if the first field duplicates an existing note (default false)",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / cardIds / description
      Previous value: -"Card IDs to get info for"New value: +"get_info: card IDs (max 50)"
    • addedInput schema / properties / chunkSize
      Added value: +{
      +  "description": "create_batch: notes per AnkiConnect request (default 10)",
      +  "maximum": 50,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • changedInput schema / properties / deckName / description
      Previous value: -"Deck name (for create operations)"New value: +"create: target deck (required). create_batch: default deck for notes without their own deckName"
    • addedInput schema / properties / dryRun
      Added value: +{
      +  "description": "create_batch: validate every note and report problems without writing anything",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / duplicateScope
      Added value: +{
      +  "description": "create/create_batch: where to look for duplicates: \"collection\" (default) or only the target \"deck\"",
      +  "enum": [
      +    "deck",
      +    "collection"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / fields / description
      Previous value: -"Field name-value pairs (for create/update)"New value: +"create/update: field name -> value (HTML allowed). Names must match the note type, e.g. { \"Front\": \"...\", \"Back\": \"...\" }"
    • addedInput schema / properties / fields / propertyNames
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / filePath
      Added value: +{
      +  "description": "create_batch: absolute path to a .json (array of notes like `notes`), .csv or .tsv file. CSV/TSV: header row = field names, plus optional \"tags\" (space-separated), \"deck\" and \"model\" columns. Use instead of notes",
      +  "type": "string"
      +}
    • changedInput schema / properties / includeDetails / description
      Previous value: -"Include detailed note info (for find)"New value: +"find: include full note fields/tags instead of only IDs (larger output)"
    • changedInput schema / properties / limit / description
      Previous value: -"Max results to return (default: 50, recommended to prevent context overflow)"New value: +"find: max results per page (default 50)"
    • changedInput schema / properties / modelName / description
      Previous value: -"Note type/model name (for create operations)"New value: +"create: note type (required), e.g. \"Basic\". create_batch: default note type for notes without their own. Use manage_models list for field names"
    • changedInput schema / properties / noteId / description
      Previous value: -"Note ID (for update/delete single note)"New value: +"update: ID of the note to change"
    • changedInput schema / properties / noteIds / description
      Previous value: -"Note IDs (for delete multiple)"New value: +"delete/add_tags/remove_tags: note IDs to act on"
    • changedInput schema / properties / notes / description
      Previous value: -"Array of notes to create (for create_batch)"New value: +"create_batch: notes to add (or use filePath instead)"
    • removedInput schema / properties / notes / items / additionalProperties
      Removed value: -false
    • addedInput schema / properties / notes / items / properties / deckName / description
      Added value: +"Overrides the top-level deckName for this note"
    • addedInput schema / properties / notes / items / properties / fields / description
      Added value: +"Field name -> value (HTML allowed), e.g. { \"Front\": \"...\", \"Back\": \"...\" }"
    • addedInput schema / properties / notes / items / properties / fields / propertyNames
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / notes / items / properties / modelName / description
      Added value: +"Overrides the top-level modelName for this note"
    • addedInput schema / properties / notes / items / properties / tags / description
      Added value: +"Added to the top-level tags"
    • changedInput schema / properties / notes / items / required
      Previous value: -[
      -  "deckName",
      -  "modelName",
      -  "fields"
      -]New value: +[
      +  "fields"
      +]
    • changedInput schema / properties / offset / description
      Previous value: -"Number of results to skip for pagination (default: 0)"New value: +"find: results to skip, for paging (default 0)"
    • changedInput schema / properties / operation / description
      Previous value: -"The flashcard operation to perform"New value: +"Which operation to run; see the tool description for required parameters"
    • changedInput schema / properties / query / description
      Previous value: -"Anki search query (for find operation)"New value: +"find: Anki search query, e.g. \"deck:Spanish tag:verbs added:7\""
    • changedInput schema / properties / tags / description
      Previous value: -"Tags to add/remove or set"New value: +"create: tags for the note. create_batch: added to every note. update: replaces the note's tags. add_tags/remove_tags: tags to add/remove"
  3. Addedv1.0.0

TDQS

A4.9/5.0
Behavior5/5

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

Goes well beyond the annotations (destructiveHint=true, idempotentHint=false): create 'writes immediately', delete is 'permanently ... Cannot be undone', dryRun is rejected for other operations, batch validation order and chunkSize default 10 are stated, partial-failure behavior is described ('stops and lists which notes were saved and which to resend'), and listings are capped at ~20k chars with a hint to narrow. It also flags the dependency ('Fails with a clear message if Anki isn't running').

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?

Front-loaded purpose and sibling routing precede a scannable per-operation parameter list, so the density is organized rather than rambling. It is long for a tool description, and some passages (the search 'power-ups' catalogue, saturation hints) could be tightened, but nearly every sentence carries actionable detail.

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 a 22-parameter, 9-operation tool with nested objects and no output schema, the description explains what find returns ('a header with the total match count and next offset, then one line per note'), how batch results map notes to IDs or failure reasons, and the truncation/paging limits. Nothing an agent needs to invoke an operation correctly appears to be missing.

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

Parameters5/5

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

Schema coverage is already 100%, yet the description adds genuine meaning: which parameters each operation requires, top-level deckName/modelName acting as overridable defaults for create_batch, top-level tags applied to every note, include defaults and the includeDetails shorthand, groupBy counting over ALL matches while ignoring limit, and hand-written Anki search syntax examples (rated:2:1, prop:lapses>=3, added:7). That is operational semantics the schema does not carry.

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?

Opens with a specific verb set plus resource ('Create, search, inspect, edit, tag and delete Anki notes ... via AnkiConnect') and immediately draws boundaries against three named siblings (manage_decks, manage_models, manage_scheduling). An agent can tell without opening any schema that this is the card-content tool, not the deck-structure or review-state tool.

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?

Explicit routing is given: card content here, deck structure/limits to manage_decks, note-type fields to manage_models, review state to manage_scheduling, and the 'writing_good_flashcards' prompt for authoring advice. It further routes specific questions ('today's due counts per deck, use manage_decks get_stats') and prefers filePath for large imports, so when-to-use and when-to-use-something-else are both covered.

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