append-to-note
Append markdown content to an existing Apple Note. Identify the note by its note ID, title, or folder path to disambiguate duplicate titles.
Instructions
Append content to the end of an existing Apple Note. Identify note by noteId or title.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| noteId | No | Apple Notes ID. If provided, skips title resolution. | |
| title | No | Title of the note to append to | |
| path | No | Optional folder path to disambiguate duplicate titles | |
| content | Yes | Content in markdown format to append to the end of the note |
Implementation Reference
- index.ts:772-787 (handler)The core handler function that executes the append-to-note logic. It uses JXA (JavaScript for Automation) to find the note by ID, get its current body, and set the body to currentBody + contentToAppend. Note that it appends raw HTML content (already converted from markdown by the caller).
const appendToNote = async (noteId: string, content: string) => { await verboseRunJxa( `const app = Application('Notes'); const noteId = args[0]; const contentToAppend = args[1]; const note = Array.from(app.notes()).find(note => { return note.id() === noteId; }); if (!note) throw new Error('__NOTE_NOT_FOUND__:' + noteId); const currentBody = note.body(); note.body = currentBody + contentToAppend; note.name = note.name(); return true;`, [noteId, content] ); }; - index.ts:122-129 (schema)Zod schema for validating append-to-note input. Accepts optional noteId, title, path and required content. Requires either noteId or title.
const AppendToNoteSchema = z .object({ noteId: z.string().optional(), title: z.string().optional(), path: z.string().optional(), content: z.string(), }) .refine((d) => d.noteId || d.title, { message: "Either noteId or title must be provided" }); - index.ts:304-327 (registration)Tool registration metadata in the ListToolsRequestSchema handler. Defines the name, description, and input schema that is exposed to MCP clients.
{ name: "append-to-note", description: "Append content to the end of an existing Apple Note. Identify note by noteId or title.", inputSchema: { type: "object", properties: { noteId: { type: "string", description: "Apple Notes ID. If provided, skips title resolution.", }, title: { type: "string", description: "Title of the note to append to" }, path: { type: "string", description: "Optional folder path to disambiguate duplicate titles", }, content: { type: "string", description: "Content in markdown format to append to the end of the note", }, }, required: ["content"], }, }, - index.ts:17-23 (registration)List of mutating tools, including append-to-note, used to filter tools in read-only mode.
const MUTATING_TOOLS = new Set([ "create-note", "edit-note", "append-to-note", "move-note", "delete-note", ]); - index.ts:964-974 (helper)The CallToolRequestSchema handler that routes 'append-to-note' calls. It parses arguments with AppendToNoteSchema, resolves the note via resolveNoteId, calls appendToNote with HTML-converted content, refreshes the index, and returns the result.
} else if (name === "append-to-note") { const { noteId, title, path, content } = AppendToNoteSchema.parse(args); const { note: resolvedNote } = await resolveNoteId(notesTable, noteId, title, path); await appendToNote(resolvedNote.id, markdownToHtml(content)); const note = await refreshIndexedNoteById(notesTable, resolvedNote.id); return createJsonResponse({ ok: true, data: note, message: `Appended content to "${resolvedNote.title}".`, }); } else if (name === "move-note") {