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

advanced.reviews.import

advanced_reviews_import
Destructive

Import historical review-log records into Anki without rescheduling cards; validates IDs and duplicates, then writes all entries in one database transaction.

Instructions

Import historical revlog records, not live answers.

Validate all records; reject duplicate IDs both internally and against collection. Derive answeredAt from ID, set usn=-1 locally. Bound SQL in one database transaction; no schema interpolation. Do not change card scheduling/counters or claim a live answer. FSRS memory remains current stored state; later recomputation may consume imported history. Expose only when transactional import and post-write notifications are verified.

Anki-Connect method advanced.reviews.import. Scope: collection. Effect: advancedWrite. Completion: operation. Undo: clears.

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

Possible errors: collectionUnavailable, conflict, editorConflict, internalError, invalidParams, notFound, staleSession, unsupportedCapability, validationFailed.

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": {
      "reviews": "<reviews>"
    },
    "name": "advanced_reviews_import"
  }
}

Input Schema

NameRequiredDescriptionDefault
reviewsYesHistorical review-log records to add (they do not reschedule cards).
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

A4.6/5.0
Behavior5/5

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

Goes well past the annotations: validation and duplicate-ID rejection, answeredAt derivation from ID, usn=-1 assignment, single database transaction with no schema interpolation, non-effect on scheduling/counters/FSRS state, and 'Undo: clears'. It also discloses long-running semantics (waitForCompletion/timeoutSeconds) and enumerates possible error codes, which is exactly the context an agent needs for a destructive advancedWrite.

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 core distinction (historical import vs live answer), then validation, transaction, non-effect, and operations details in a logical order. Dense but nearly every clause carries behavioral information; a few items (FSRS recomputation note, 'Expose only when…') are meta-guidance but still earn their place.

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 destructive, transactional, long-running mutation with nested per-record validation, the description covers the failure modes (errors list), undo behavior, concurrency/session safety, and the fact that scheduling is untouched. No output schema exists, yet the agent is told what the operation does and does not do, which is sufficient.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3; the description still adds meaning for the `id` field (answeredAt is derived from it, duplicate IDs are rejected both internally and against the collection) beyond what the schema states. The remaining parameters (session, timeoutSeconds, waitForCompletion) are already thoroughly documented in the schema, so there is no substantial compensation needed.

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 verb+resource ('Import historical revlog records') and immediately scopes it against the sibling behavior that looks similar ('not live answers'). An agent can distinguish this from reviewer_answer / scheduling_answer without opening a schema.

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

Usage Guidelines4/5

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

Provides explicit exclusions ('Do not change card scheduling/counters or claim a live answer') and a precondition ('Expose only when transactional import and post-write notifications are verified'). It stops short of naming an alternative sibling such as reviews_list for reading history, so routing is implied rather than fully enumerated.

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