Skip to main content
Glama
anki-connect-mcp
by SolarianGG

packages.import

packages_import
Destructive

Import .apkg or .colpkg packages into an Anki collection to add decks or restore backups, waiting for the operation to finish and returning the final import result.

Instructions

Import an Anki package with normal collection completion.

Anki-Connect method packages.import. Scope: collection. Effect: write. Completion: operation. Undo: clears.

Long-running operation: by default the server waits for the final result (see waitForCompletion / timeoutSeconds).

Possible errors: cancelled, collectionUnavailable, editorConflict, internalError, invalidParams, ioError, notFound, staleSession.

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": {
      "path": "<path>"
    },
    "name": "packages_import"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesPath to an .apkg/.colpkg file on the machine running Anki.
sessionNoOptional. Collection session ID: the `session` field returned by `collection_get`. Usually omit it — the server then uses the session current at the time of the call. Pass it to make the call fail with `staleSession` instead of acting on a different profile/collection than the one your IDs, cursors and tokens came from.
timeoutSecondsNoMCP option (not sent to Anki): how long to wait for completion. A timeout does not cancel the work; the pending record is returned.
waitForCompletionNoMCP option (not sent to Anki): poll operations.get until the operation finishes and return its final record. If false, return the operation handle.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

Beyond the annotations (which already flag write + destructive), the description adds real value: scope 'collection', 'Undo: clears', an explicit error taxonomy including `editorConflict` and `staleSession`, and the fact that a timeout does not cancel the work. It stops short of saying whether a `.colpkg` import replaces or merges into the existing collection, which is the key unknown for a destructive operation.

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 with the action, then compact metadata lines for scope/effect/undo, the long-running note, and the error list. The structured line-by-line format is scannable and wastes little, though the 'Anki-Connect method' line is largely redundant with the tool name.

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?

For a destructive, long-running import with no output schema, the definition covers async behavior, undo side effects, and failure modes well. The remaining gap is the effect on pre-existing collection data and what the returned operation record contains, which matters for an import that can destroy state.

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 description coverage is 100%, so all four parameters are already well documented in the schema, including the MCP-only nature of `waitForCompletion` and `timeoutSeconds`. The description merely cross-references those names without adding new semantics, which is the expected baseline when the schema carries the burden.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Import an Anki package') plus the scope ('collection'), so the agent knows exactly what is happening. It does not, however, differentiate from the nearby `application_importFile` sibling, which an agent could plausibly confuse with this one.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: the schema note about `.apkg/.colpkg` paths tells the agent what input fits, but the description never says when to prefer this over `application_importFile` or `collection_sync`. The `waitForCompletion`/`timeoutSeconds` reference gives operational guidance for long imports but not selection guidance.

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

Deploy Server

Other Tools