Delete Note
delete_noteDelete a note by its ID, removing it permanently. Use this to remove unwanted notes from your collection.
Instructions
Delete a note by ID.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Note ID (x-coredata:// format) |
Implementation Reference
- src/notes/tools.ts:303-327 (handler)Handler function for the delete_note tool: checks shared note guard, then executes JXA script to delete the note, returns result.
server.registerTool( "delete_note", { title: "Delete Note", description: "Delete a note by ID. The note is moved to Recently Deleted and permanently removed after 30 days.", inputSchema: { id: z.string().max(500).describe("Note ID (x-coredata:// format)"), }, annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false, }, }, async ({ id }) => { try { const blocked = await guardShared(id, config, "delete_note"); if (blocked) return errPermission(blocked); const result = await runJxa<DeleteResult>(deleteNoteScript(id)); return ok(result); } catch (e) { return errJxaFor("delete note", e); } }, - src/notes/tools.ts:308-310 (schema)Input schema for delete_note: requires a single 'id' string parameter (max 500 chars) identifying the note.
inputSchema: { id: z.string().max(500).describe("Note ID (x-coredata:// format)"), }, - src/notes/tools.ts:303-304 (registration)Registration of the delete_note tool via server.registerTool in the registerNoteTools function.
server.registerTool( "delete_note", - src/notes/scripts.ts:205-213 (helper)JXA helper function that generates the AppleScript/JXA script to delete a note by ID. Accesses the Notes application, finds the note by ID, deletes it, and returns {deleted: true, name}.
export function deleteNoteScript(id: string): string { return ` const Notes = Application('Notes'); const note = Notes.notes.byId('${esc(id)}'); const name = note.name(); Notes.delete(note); JSON.stringify({deleted: true, name: name}); `; } - src/shared/tool-links.ts:37-37 (helper)Tool-link mapping: after reading a note, suggests delete_note as a next action with the note ID passed as argument.
{ tool: "delete_note", description: "Delete this note", args: { noteId: "{{id}}" } },