editors.updateDraft
editors_updateDraftUpdate an Add draft by replacing or appending specified fields and tags, with note type and deck replacement, validating inputs before altering the draft.
Instructions
Update an Add draft through coordinated dialog setters.
Set note type before explicit deck. replace changes only supplied fields/tags. append concatenates supplied field strings and unions tags; deck/type still replace. Reject invalid fields before altering the draft.
Anki-Connect method editors.updateDraft. Scope: collection. Effect: gui. Completion: operation. Undo: none.
Long-running operation: by default the server waits for the final result (see waitForCompletion / timeoutSeconds).
Possible errors: collectionUnavailable, editorConflict, internalError, invalidParams, 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": {
"editorId": "<editorId>",
"patch": "<patch>"
},
"name": "editors_updateDraft"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | `replace` (default) overwrites supplied fields/tags; `append` appends to fields and unions tags. | replace |
| patch | Yes | Draft changes: {noteType?, deck?, fields?, tags?}. | |
| 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. | |
| editorId | Yes | Editor `id` from the completed `editors_openAdd` operation. | |
| 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. |