Delete Note
vault_delete_noteRemove a markdown note from your Obsidian vault, honoring its trash settings for safe or permanent deletion, with optional empty folder pruning.
Instructions
Delete a markdown note, honoring the vault's Obsidian "Deleted files" setting (trashOption in .obsidian/app.json) when the vault is served locally. "Move to system trash" — Obsidian's default, and what an absent setting means — moves the note to .trash/ inside the vault (a container has no system trash, and .trash/ is Obsidian's own fallback for that), where the server cleans up its copies after a retention window (TRASH_RETENTION_DAYS, default 30 days; none keeps them forever). "Move to Obsidian trash (.trash folder)" (local) also moves the note to .trash/, kept forever — matching Obsidian. "Permanently delete" (none) removes the note for good. Only notes this server moved to .trash/ under the system setting are subject to the retention window — notes Obsidian itself trashed are never touched. When Obsidian Sync is configured, the trash setting is bypassed and notes are always permanently deleted — recovery is through Sync's version history, not .trash/. After deletion, links to it from other notes become broken (detectable via vault_get_backlinks). Protected paths (About Me/ and the daily notes folder (read from DAILY_NOTES_FOLDER or .obsidian/daily-notes.json, defaulting to Daily Notes/)) are refused.
Example: vault_delete_note({ path: "Scratch/temp.md" }) Example: vault_delete_note({ path: "Archive/2024/old.md", prune_empty_folders: true }) — also remove "Archive/2024" (and "Archive") if deleting the note empties them.
When to use: Removing a note you no longer need. Prefer vault_delete_memory for removing individual dated entries from About Me/ memory files.
Behavior: With prune_empty_folders, pruning is best-effort and runs after the delete or trash move — it never fails the call, so the note is always gone from its original path even if a folder can't be removed. If your vault uses Obsidian Sync, deleted notes are recoverable from Sync's version history (1 month on Standard, 12 months on Plus).
Errors:
"cannot delete protected path" — the path sits under a protected folder; use vault_delete_memory for memory entries
"absolute path blocked" — the path starts at the filesystem root; use a vault-relative path
"path traversal blocked" — path escapes the vault root; use a vault-relative path
"hidden path blocked" — the path targets a hidden (dot-prefixed) file or folder like ".obsidian/"; hidden paths are not deletable, matching Obsidian
"concurrent write in progress" — another write to this note is in flight; retry
"note not found: …" — the note does not exist; verify the path with vault_list_notes before deleting
"cannot move to trash … — 100 collisions in .trash/" — the note's name already exists 100 times in .trash/; clear old trash files to free the name
"cannot move to trash …" — the .trash/ move failed (e.g. a plain file blocks a needed directory); the note remains at its original path
"cannot delete …" — permanent delete failed (e.g. permissions); the note remains at its original path
"cannot read trash config from .obsidian/app.json" — the config file exists but is unreadable (permissions, corruption); the delete is blocked to prevent accidental permanent deletion when the user may have configured .trash/ retention
Returns: Confirmation message naming the outcome — "Deleted" for permanent removal, "Moved to trash" when the note landed in .trash/. Notes how many empty folders were pruned when any were.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Vault-relative path of the note to delete, including the ".md" extension | |
| prune_empty_folders | No | When true, remove the note's parent folder(s) if deleting it leaves them empty, walking up to (but never including) the vault root. Default false matches Obsidian, which leaves empty folders in place. Only removes a folder with zero entries — a folder still holding any file, including a hidden one like .DS_Store, is left alone. |