collection.sync
collection_syncRun one coordinated Anki GUI/background sync, optionally including media, while preventing a second concurrent sync and surfacing full-sync choices that require user action.
Instructions
Run one coordinated GUI/background sync.
Full sync choices are waitingForUser; never launch a second sync. includeMedia is intersected with profile media-sync settings.
Anki-Connect method collection.sync. Scope: collection. Effect: lifecycle. Completion: operation. Undo: none.
Long-running operation: by default the server waits for the final result (see waitForCompletion / timeoutSeconds).
Possible errors: authenticationRequired, busy, cancelled, collectionUnavailable, editorConflict, internalError, invalidParams, ioError, staleSession.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "collection_sync"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| 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. | |
| includeMedia | No | Also sync media (further limited by the profile's media-sync setting). Default true. | |
| 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. |