append_to_note
Add content to the end of existing notes in Obsidian vaults to update information without rewriting entire files.
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 appends new content to the end of an existing note file using the provided separator (default '\n\n').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:85-104 (schema)Input schema defining parameters for the append_to_note tool: path (required), content (required), separator (optional).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:82-105 (registration)Tool registration in the tools array, including name, description, and inputSchema, used for listing available tools.{ 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-881 (registration)Dispatch case in the main CallToolRequestSchema handler that routes to the append_to_note handler function.case "append_to_note": result = await handleAppendToNote( args as { path: string; content: string; separator?: string } );