Skip to main content
Glama

Manage collection: sync, packages, media

manage_collection
Destructive

Run Anki collection maintenance tasks: check version, manage profiles, sync with AnkiWeb, import/export .apkg packages, and list, store, retrieve, or delete media files.

Instructions

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.

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_collection"
  }
}

Input Schema

NameRequiredDescriptionDefault
patternNolist_media: glob pattern, e.g. "*.png" or "*"
deckNameNoexport_deck: deck to export
filePathNoexport_deck: .apkg path to write. import_package: .apkg path to read
filenameNostore_media/retrieve_media/delete_media: media file name, e.g. "cat.png"
mediaUrlNostore_media: URL Anki downloads the file from (or use mediaData)
mediaDataNostore_media: base64 file contents (or use mediaUrl)
operationYesWhich operation to run; see the tool description for required parameters
includeSchedNoexport_deck: include review history and scheduling (default false)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.0.0

TDQS

A4.4/5.0
Behavior4/5

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

Goes well beyond the annotations (destructiveHint, openWorldHint, idempotentHint=false) by disclosing per-operation side effects: sync is networked and may upload or download, export_deck writes a file to disk, store_media overwrites an existing file of the same name, delete_media removes the file. Gaps remain: no statement on reversibility of deletions, on import duplicate handling, or on error/response behavior, but for a tool whose safety profile is already declared this is strong added context.

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

Conciseness5/5

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

Front-loads purpose and scope in one paragraph, then uses a scannable per-operation bullet list where each line names the operation, its read-only/mutating nature, and its required inputs. No filler sentences; length is proportionate to a nine-operation multiplexed tool.

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?

Covers operation selection, required parameters, and side effects for a complex multiplexed tool, and there is no output schema to compensate for. Minor gap: return values are only hinted for version, retrieve_media, and list_media, while sync, export_deck, and import_package results are unspecified.

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

Parameters3/5

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

Schema coverage is 100% and the schema already labels each parameter with its owning operation (pattern, deckName, filePath, filename, mediaUrl, mediaData, includeSched default). The description mostly restates this mapping ('export_deck: needs deckName and filePath') and adds little syntax or format detail beyond what the schema provides, so the baseline 3 applies.

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?

States a specific resource (Anki collection maintenance) and enumerates the concrete operation set: sync, version, .apkg import/export, profiles, media. It explicitly carves out the non-scope ('not about card content, decks, note types or reviews'), which cleanly separates it from manage_decks, manage_flashcards, manage_models, and manage_scheduling.

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?

Gives an explicit when-to-use rule ('maintenance tasks that are not about card content...') plus an explicit alternative for the one adjacent case ('To read a media file's contents, use get_media_file'). Both a positive selection rule and a redirect are present, leaving little to inference.

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