Skip to main content
Glama
sureshsankaran

Obsidian Tools MCP Server

rename_note

Change the name or location of an Obsidian note by specifying its current and new file 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 executes the rename_note tool: resolves paths, validates existence, creates directories if needed, and renames the file using 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}`;
    }
  • Input schema for the rename_note tool, specifying oldPath and newPath as required string parameters.
    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:131-148 (registration)
    Registration of the rename_note tool in the tools array, which is returned by list_tools.
    {
      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-891 (registration)
    Registration of the handler in the main tool dispatch switch statement for call_tool requests.
    case "rename_note":
      result = await handleRenameNote(
        args as { oldPath: string; newPath: string }
      );

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