delete_note
Permanently deletes a note from your Obsidian vault. Provide the file path of the note to remove it.
Instructions
Delete a note permanently.
Args: path: Path to the note to delete
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes |
Implementation Reference
- server.py:154-173 (handler)The MCP tool handler for 'delete_note'. Decorated with @mcp.tool(), it accepts a path parameter, checks read-only mode, calls the client's delete_note method, and returns success or error responses.
@mcp.tool() def delete_note(path: str) -> dict: """Delete a note permanently. Args: path: Path to the note to delete """ try: if is_read_only(): return read_only_error() client = get_vault_client() success = client.delete_note(path) if success: return {"success": True, "message": f"Note deleted: {path}"} else: return {"error": f"Note not found: {path}"} except Exception as e: return {"error": str(e)} - obsidian_client.py:158-169 (helper)The actual implementation of delete_note in ObsidianVaultClient. Resolves the vault path, checks if the note exists (returns False if not), validates it's a .md file, optionally backs it up, and deletes it via unlink().
def delete_note(self, path: str) -> bool: """Delete a note.""" note_path = self._resolve_vault_path(path) if not note_path.exists(): return False if note_path.suffix.lower() != '.md': raise ValueError("Only markdown notes can be deleted") self._backup_note(note_path) note_path.unlink() return True - server.py:154-155 (registration)The @mcp.tool() decorator registers 'delete_note' as an MCP tool with the FastMCP server instance.
@mcp.tool() def delete_note(path: str) -> dict: