Skip to main content
Glama

rename_note

Change the name or location of a note in your Obsidian vault by specifying its current and new paths.

Instructions

Rename or move a note to a new location

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
oldPathYesCurrent path of the note
newPathYesNew path for the note

Implementation Reference

  • The handler function that performs the rename/move operation: resolves full paths, validates existence of old and absence of new path, ensures target directory exists, and renames the file using Node.js fs.rename.
    async function handleRenameNote(args: { oldPath: string; newPath: string; }): Promise<string> { const oldFullPath = resolvePath(args.oldPath); const newFullPath = resolvePath(args.newPath); if (!(await fileExists(oldFullPath))) { throw new Error(`Note not found at ${args.oldPath}`); } if (await fileExists(newFullPath)) { throw new Error(`Note already exists at ${args.newPath}`); } await ensureDir(newFullPath); await fs.rename(oldFullPath, newFullPath); return `Successfully moved note from ${args.oldPath} to ${args.newPath}`; }
  • JSON schema defining the input parameters for the rename_note tool: oldPath (current note path) and newPath (new note path), both required strings.
    inputSchema: { type: "object", properties: { oldPath: { type: "string", description: "Current path of the note", }, newPath: { type: "string", description: "New path for the note", }, }, required: ["oldPath", "newPath"], },
  • src/index.ts:132-148 (registration)
    Tool registration in the tools array, which is returned by the list tools handler, including name, description, and input schema.
    name: "rename_note", description: "Rename or move a note to a new location", inputSchema: { type: "object", properties: { oldPath: { type: "string", description: "Current path of the note", }, newPath: { type: "string", description: "New path for the note", }, }, required: ["oldPath", "newPath"], }, },
  • src/index.ts:888-892 (registration)
    Registration in the main tool dispatch switch statement that routes calls to the handleRenameNote function.
    case "rename_note": result = await handleRenameNote( args as { oldPath: string; newPath: string } ); break;

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/sureshsankaran/obsidian-tools-mcp'

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