delete_note
Remove a note from Apple Notes by specifying its title, optionally scoped to a folder. The deleted note is moved to the Recently Deleted folder for recovery.
Instructions
Delete a note from Apple Notes by title. Optionally specify folder to disambiguate. The note is moved to Recently Deleted.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Title of the note to delete | |
| folder | No | Folder name to scope the search |
Implementation Reference
- src/applescript.ts:46-60 (handler)The function that executes the AppleScript command to delete a note.
export async function deleteNote(title: string, folder?: string): Promise<void> { const folderClause = folder ? `of folder ${JSON.stringify(folder)}` : ""; const script = ` tell application "Notes" set matchedNotes to (every note ${folderClause} whose name is ${JSON.stringify(title)}) if (count of matchedNotes) = 0 then error "Note not found: ${title.replace(/"/g, '\\"')}" end if delete item 1 of matchedNotes end tell `; await runAppleScript(script); - src/index.ts:136-153 (registration)MCP tool registration for 'delete_note'.
server.tool( "delete_note", "Delete a note from Apple Notes by title. Optionally specify folder to disambiguate. The note is moved to Recently Deleted.", { title: z.string().describe("Title of the note to delete"), folder: z.string().optional().describe("Folder name to scope the search"), }, async ({ title, folder }) => { try { await deleteNote(title, folder); return { content: [{ type: "text", text: `Note "${title}" deleted successfully.` }], }; } catch (e: unknown) { return { content: [{ type: "text", text: `Error: ${(e as Error).message}` }], isError: true, };