advanced.reviews.import
advanced_reviews_importImport 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
| Name | Required | Description | Default |
|---|---|---|---|
| reviews | Yes | Historical review-log records to add (they do not reschedule cards). | |
| session | No | Optional. 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. | |
| timeoutSeconds | No | MCP option (not sent to Anki): how long to wait for completion. A timeout does not cancel the work; the pending record is returned. | |
| waitForCompletion | No | MCP option (not sent to Anki): poll operations.get until the operation finishes and return its final record. If false, return the operation handle. |