delete_note
Delete a note from your Obsidian vault with a safe soft-delete to .trash by default, or choose permanent removal. Use expected_hash to ensure you only delete the version you last read.
Instructions
Delete a note from the vault. Requires write permission — a readwrite API key, or an OAuth token
carrying the readwrite scope.
By default this is a soft-delete: the file is moved to
.trash/<YYYYMMDD-HHMMSS>-<basename>-<8 hex> inside the vault root, by a
single non-replacing rename, so an existing trash entry is never
overwritten and two deletes in the same second land on distinct names. The
indexer skips dot-prefixed directories, so search and embeddings drop the
note automatically on the next reindex pass (≤ 5 minutes). Soft-deleted
files accumulate in .trash/ — emptying that directory is the user's
responsibility.
A vault filesystem that cannot perform that non-replacing rename into
.trash/ makes the soft delete refuse with an error naming the limitation
rather than fall back to a rename that could overwrite; pass
permanent=True to unlink instead.
With permanent=True, the file is unlinked directly with no recovery path
inside this server. Existing backups are the rollback story.
A path whose final component is a symlink is refused, naming its target, so a delete never removes a note other than the one named; symlinked folders inside the vault work normally.
Dangling backlinks left behind by a delete are surfaced via
get_backlinks and find_orphans. See get_vault_guide for context.
expected_hash — binding a write to the bytes you read. Optional; omit
it and nothing changes. Pass the content_hash a read returned, verbatim
and canonical (sha256:<64 lowercase hex>), and the call is refused with
nothing written if the file changed in between. It is always the whole
file's hash, never a hash of the text you received. expected_hash
covers your read through this call's preflight read. The delete acts through the
pinned parent directory but does not compare the bytes again: an in-place edit after that
comparison can still be deleted. Precondition refusals end with one
machine-readable MCP-REFUSAL {"code":…} line — stale_precondition (with
the file's current hash, ready to resend), concurrent_write,
no_incumbent, malformed_precondition, precondition_unavailable,
precondition_required — and each states what resolves it.
It applies in both modes, and the comparison runs before the .trash
rename and before the unlink, so a refused delete leaves the note where it
was and creates no trash entry. A successful delete reports no
content_hash: nothing remains to hash.
Args:
path: Vault-relative path to the note.
permanent: If True, unlink instead of soft-deleting.
expected_hash: The note's content_hash as you last read it. Refuses
the delete, changing nothing, if the note has changed since.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| permanent | No | ||
| expected_hash | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |