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
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path to the note to update relative to vault root | |
| content | Yes | New content for the note |
Implementation Reference
- src/index.ts:464-476 (handler)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}`; }
- src/index.ts:67-80 (schema)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;