Delete media file
delete-media-filePreviews Note, card template, and CSS references before moving a media file to Anki's trash, requiring a reviewed hash, reference count, fingerprint, and confirmation to apply.
Instructions
Previews exact Note, Card Template, and CSS references before moving one media file to Anki's media trash. Applying requires the reviewed file hash, reference count, reference fingerprint, and explicit confirmation. Incomplete Note or CSS scans block deletion even with confirmations enabled.
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": {
"filename": "<filename>"
},
"name": "delete-media-file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dryRun | No | Inspect exact bytes and all detectable references without deleting the file | |
| filename | Yes | Portable filename inside Anki's flat collection.media folder | |
| expectedSha256 | No | File hash returned by the dry run; required when applying | |
| confirmDeletion | No | Must be true when applying media deletion | |
| expectedReferenceCount | No | Reference count returned by the dry run; required when applying | |
| confirmBrokenReferences | No | Must be true when applying deletion while Notes, Card Templates, or CSS still reference the file | |
| expectedReferenceFingerprint | No | usage.referenceFingerprint returned by a complete dry run; required when applying, even if the reference count is unchanged |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | ||
| usage | Yes | ||
| dryRun | Yes | ||
| exists | Yes | ||
| applied | Yes | ||
| blockers | Yes | ||
| filename | Yes | ||
| warnings | Yes |