Skip to main content
Glama
ailenshen

Apple Notes MCP Server

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
NameRequiredDescriptionDefault
titleYesTitle of the note to delete
folderNoFolder name to scope the search

Implementation Reference

  • 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,
          };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ailenshen/apple-notes-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server