append_to_note
Add content to the end of an existing note in your Obsidian vault. Specify the note path and content to append, with optional separator formatting.
Instructions
Append content to the end of an existing note
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path to the note relative to vault root | |
| content | Yes | Content to append | |
| separator | No | Separator to add before appended content. Default: '\n\n' |
Implementation Reference
- src/index.ts:478-494 (handler)The handler function that reads an existing note, appends the provided content with an optional separator, and writes it back to the file.async function handleAppendToNote(args: { path: string; content: string; separator?: string; }): Promise<string> { const fullPath = resolvePath(args.path); const separator = args.separator ?? "\n\n"; if (!(await fileExists(fullPath))) { throw new Error(`Note not found at ${args.path}`); } const existingContent = await fs.readFile(fullPath, "utf-8"); const newContent = existingContent + separator + args.content; await fs.writeFile(fullPath, newContent, "utf-8"); return `Successfully appended content to ${args.path}`; }
- src/index.ts:82-104 (schema)The input schema definition for the append_to_note tool, including parameters for path, content, and optional separator.{ name: "append_to_note", description: "Append content to the end of an existing note", inputSchema: { type: "object", properties: { path: { type: "string", description: "Path to the note relative to vault root", }, content: { type: "string", description: "Content to append", }, separator: { type: "string", description: "Separator to add before appended content. Default: '\\n\\n'", default: "\n\n", }, }, required: ["path", "content"], },
- src/index.ts:878-882 (registration)The switch case in the main tool call handler that dispatches to the append_to_note handler function.case "append_to_note": result = await handleAppendToNote( args as { path: string; content: string; separator?: string } ); break;