Skip to content

[Apple Notes] get-note-content and update-note AI tools fail with error -1728 due to note ID format mismatch #25706

Closed

Description

@jasondk

Extension

https://www.raycast.com/raycast/apple-notes

Raycast Version

1.104.6

OS Version

26.2

Description

The get-note-content and update-note AI tools frequently fail with AppleScript error -1728 because the AI passes the note's UUID (ZIDENTIFIER) instead of the x-coredata ID that AppleScript requires.

The search-notes tool returns notes with two different ID fields:

  • id / noteId: the x-coredata format, e.g. x-coredata://81243823-DC1E-4D85-81EC-3C075E135B4E/ICNote/p3910
  • UUID: the ZIDENTIFIER from the database, e.g. 5AEC22F4-7356-456E-9D0C-112466B97201

The get-note-content and update-note tools pass the received noteId directly into AppleScript:

tell application "Notes"
  set theNote to note id "${noteId}"
  return body of theNote
end tell

AppleScript only accepts the x-coredata format. When the AI passes the UUID format (which it does unpredictably, since both are present in the search results and the tool schema gives no guidance), the call fails with:

Notes got an error: Can't get note id "5AEC22F4-7356-456E-9D0C-112466B97201". (-1728)

Suggested Fix

Two changes, ideally both applied:

a) Make the tools accept both ID formats. Before passing the noteId to AppleScript, check if it starts with x-coredata://. If not, resolve it via the SQLite database using the existing executeSQL utility:

// In helpers.ts
import { executeSQL } from "@raycast/utils";

const NOTES_DB = resolve(homedir(), "Library/Group Containers/group.com.apple.notes/NoteStore.sqlite");

export async function resolveNoteId(noteId: string): Promise<string> {
  if (noteId.startsWith("x-coredata://")) {
    return noteId;
  }
  const result = await executeSQL<{ id: string }>(
    NOTES_DB,
    `SELECT 'x-coredata://' || zmd.z_uuid || '/ICNote/p' || note.z_pk AS id
     FROM ziccloudsyncingobject AS note
     LEFT JOIN z_metadata AS zmd ON 1=1
     WHERE note.zidentifier = '${noteId.replace(/'/g, "''")}'
     LIMIT 1`,
  );
  return result?.[0]?.id ?? noteId;
}

b) Improve the tool input schema. Update the noteId description in both tool Input types and in the extension's package.json instructions to steer the AI toward the correct format:

type Input = {
  /** The x-coredata ID of the note (starts with 'x-coredata://'). Use the 'id' field from search results, NOT the 'UUID' field. */
  noteId: string;
};

Steps To Reproduce

  1. Use Raycast AI with the Apple Notes extension
  2. Ask it to retrieve the content of a specific note (e.g. "What's in my note called [note title]?")
  3. The AI calls search-notes, gets results containing both id and UUID fields
  4. The AI calls get-note-content with the UUID instead of the x-coredata ID
  5. AppleScript error -1728

This doesn't happen every time — it depends on which ID field the AI selects. But it's frequent enough to make the tool unreliable.__

Current Behaviour

When the AI passes the UUID format (e.g. 5AEC22F4-7356-456E-9D0C-112466B97201) instead of the x-coredata format, get-note-content and update-note fail with:

Notes got an error: Can't get note id "5AEC22F4-7356-456E-9D0C-112466B97201". (-1728)

The error occurs because AppleScript's Notes dictionary only accepts the x-coredata URI format for note IDs. Since search-notes returns both formats and the tool schema provides no guidance on which to use, the AI selects the wrong one unpredictably.

Expected Behaviour

get-note-content and update-note should reliably retrieve/update the correct note regardless of which ID format the AI passes. Either the tools should accept both ID formats (resolving UUIDs to x-coredata IDs before calling AppleScript), or the schema should clearly guide the AI to always use the id field (x-coredata format) from search-notes results.

Activity

  1. added
    bug
    on Feb 22, 2026
  2. added theissue type on Feb 22, 2026
  3. added
    extension
    on Feb 22, 2026
  4. added
    extension: apple-notes
    on Feb 22, 2026
  5. raycastbot commented on Feb 22, 2026

    @raycastbot
    Collaborator

    Thank you for opening this issue!

    🔔 @tumispro @ron-myers @mathieudutour @StevenRCE0 @SKaplanOfficial @tylerwince @xilopaint @ridemountainpig @teemusuvinen @saldanaj97 @andreaselia @fanhefeng @charlesharries you might want to have a look.

    💡 Author and Contributors commands

    The author and contributors of raycast/apple-notes can trigger bot actions by commenting:

    • @raycastbot close this issue Closes the issue.
    • @raycastbot close as not planned Closes the issue as not planned.
    • @raycastbot close as duplicate Closes the issue as duplicate.
    • @raycastbot rename this issue to "Awesome new title" Renames the issue.
    • @raycastbot reopen this issue Reopens the issue.
    • @raycastbot assign me Assigns yourself to the issue.
    • @raycastbot good first issue Adds the "Good first issue" label to the issue.
    • @raycastbot keep this issue open Make sure the issue won't go stale and will be kept open by the bot.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugextensionextension: apple-notes

    Type

    Fields

    Priority

    None yet

    Severity

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions