Skip to main content
Glama
sureshsankaran

Obsidian Tools MCP Server

update_note

Replace the entire content of an existing note in Obsidian vaults by specifying the file path and new content.

Instructions

Update/replace the entire content of an existing note

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath to the note to update relative to vault root
contentYesNew content for the note

Implementation Reference

  • The main handler function for the 'update_note' tool. It resolves the full file path, checks if the note exists, overwrites the file with the new content, and returns a success message.
    async function handleUpdateNote(args: {
      path: string;
      content: string;
    }): Promise<string> {
      const fullPath = resolvePath(args.path);
    
      if (!(await fileExists(fullPath))) {
        throw new Error(`Note not found at ${args.path}`);
      }
    
      await fs.writeFile(fullPath, args.content, "utf-8");
      return `Successfully updated note at ${args.path}`;
    }
  • Input schema definition for the 'update_note' tool, specifying required 'path' and 'content' parameters.
    inputSchema: {
      type: "object",
      properties: {
        path: {
          type: "string",
          description: "Path to the note to update relative to vault root",
        },
        content: {
          type: "string",
          description: "New content for the note",
        },
      },
      required: ["path", "content"],
    },
  • src/index.ts:64-81 (registration)
    Registration of the 'update_note' tool in the tools array, including name, description, and input schema. This array is returned by the ListToolsRequest handler.
    {
      name: "update_note",
      description: "Update/replace the entire content of an existing note",
      inputSchema: {
        type: "object",
        properties: {
          path: {
            type: "string",
            description: "Path to the note to update relative to vault root",
          },
          content: {
            type: "string",
            description: "New content for the note",
          },
        },
        required: ["path", "content"],
      },
    },
  • src/index.ts:873-877 (registration)
    Dispatch case in the tool call handler that routes 'update_note' calls to the handleUpdateNote function.
    case "update_note":
      result = await handleUpdateNote(
        args as { path: string; content: 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