move_note
Move or rename notes in Obsidian vaults by specifying current and new file paths to reorganize your knowledge base.
Instructions
Move or rename a note to a new path
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| oldPath | Yes | Current relative path of the note | |
| newPath | Yes | New relative path for the note |
Implementation Reference
- src/lib/vault.ts:142-157 (handler)The implementation of the moveNote function which handles moving or renaming a note within the vault.
export async function moveNote( vaultPath: string, oldPath: string, newPath: string, ): Promise<void> { const fullOldPath = resolveVaultPath(vaultPath, oldPath); const fullNewPath = resolveVaultPath(vaultPath, newPath); try { await fs.access(fullNewPath); throw new Error(`Destination already exists: ${newPath}`); } catch (err) { if ((err as NodeJS.ErrnoException).code !== "ENOENT") throw err; } await fs.mkdir(path.dirname(fullNewPath), { recursive: true }); await fs.rename(fullOldPath, fullNewPath); }