Skip to main content
Glama

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
NameRequiredDescriptionDefault
oldPathYesCurrent relative path of the note
newPathYesNew relative path for the note

Implementation Reference

  • 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);
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rps321321/obsidian-mcp-pro'

If you have feedback or need assistance with the MCP directory API, please join our Discord server