apple-notes-mcp 2.6.16 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/build/index.js +37 -28
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -593,7 +593,11 @@ Lists all notes, optionally filtered by folder, date, and limit.
|
|
|
593
593
|
}
|
|
594
594
|
```
|
|
595
595
|
|
|
596
|
-
**Returns:** List of
|
|
596
|
+
**Returns:** List of notes as `{title, id}` pairs — `notes: Array<{title, id}>`, plus `count`. The human-readable line is ` - <title> [id: <id>]`.
|
|
597
|
+
|
|
598
|
+
Use the returned `id` for any follow-up read/update/move/delete rather than re-resolving the title: titles are not unique, and a by-title lookup resolves a duplicated title to the same one note every time, silently skipping the others.
|
|
599
|
+
|
|
600
|
+
> **Changed in 2.7.0:** `notes` was previously `string[]` (titles only). Callers that treated the array as strings must now read `.title`.
|
|
597
601
|
|
|
598
602
|
---
|
|
599
603
|
|
package/build/index.js
CHANGED
|
@@ -40100,29 +40100,12 @@ var AppleNotesManager = class {
|
|
|
40100
40100
|
return refs;
|
|
40101
40101
|
}
|
|
40102
40102
|
/**
|
|
40103
|
-
*
|
|
40104
|
-
*
|
|
40105
|
-
*
|
|
40103
|
+
* Core listing path shared by `listNotes()` and `listNoteRefs()`: lists
|
|
40104
|
+
* notes in an account, optionally filtered by folder, date, and limit,
|
|
40105
|
+
* returning (title, id) pairs. Kept private because both public callers
|
|
40106
|
+
* need to apply their own return shape.
|
|
40106
40107
|
*/
|
|
40107
|
-
|
|
40108
|
-
const folderRef = folder ? buildFolderReference(folder) : void 0;
|
|
40109
|
-
const script = buildAccountScopedScript({ account }, this.buildBulkListCommand({ folderRef }));
|
|
40110
|
-
const result = executeAppleScript(script);
|
|
40111
|
-
if (!result.success) {
|
|
40112
|
-
throw new Error(`Failed to list notes: ${result.error ?? "unknown error"}`);
|
|
40113
|
-
}
|
|
40114
|
-
return this.parseBulkListOutput(result.output);
|
|
40115
|
-
}
|
|
40116
|
-
/**
|
|
40117
|
-
* Lists all notes in an account, optionally filtered by folder, date, and limit.
|
|
40118
|
-
*
|
|
40119
|
-
* @param account - Account to list notes from (defaults to iCloud)
|
|
40120
|
-
* @param folder - Optional folder to filter by
|
|
40121
|
-
* @param modifiedSince - Optional ISO 8601 date string to filter notes modified on or after this date
|
|
40122
|
-
* @param limit - Optional maximum number of results to return (default: no limit)
|
|
40123
|
-
* @returns Array of note titles
|
|
40124
|
-
*/
|
|
40125
|
-
listNotes(account, folder, modifiedSince, limit) {
|
|
40108
|
+
listNotesCore(account, folder, modifiedSince, limit) {
|
|
40126
40109
|
const targetAccount = this.resolveAccount(account);
|
|
40127
40110
|
const safeLimit = limit !== void 0 && limit > 0 ? Math.floor(limit) : void 0;
|
|
40128
40111
|
const folderRef = folder ? buildFolderReference(folder) : void 0;
|
|
@@ -40148,7 +40131,7 @@ var AppleNotesManager = class {
|
|
|
40148
40131
|
const records = sepIdx === -1 ? "" : result2.output.slice(sepIdx + 1);
|
|
40149
40132
|
const refs = this.parseBulkListOutput(records, safeLimit);
|
|
40150
40133
|
if (!Number.isNaN(totalCount) && (refs.length >= safeLimit || totalCount <= safeLimit)) {
|
|
40151
|
-
return refs
|
|
40134
|
+
return refs;
|
|
40152
40135
|
}
|
|
40153
40136
|
}
|
|
40154
40137
|
const script = buildAccountScopedScript(
|
|
@@ -40159,7 +40142,33 @@ var AppleNotesManager = class {
|
|
|
40159
40142
|
if (!result.success) {
|
|
40160
40143
|
throw new Error(`Failed to list notes: ${result.error ?? "unknown error"}`);
|
|
40161
40144
|
}
|
|
40162
|
-
return this.parseBulkListOutput(result.output, safeLimit)
|
|
40145
|
+
return this.parseBulkListOutput(result.output, safeLimit);
|
|
40146
|
+
}
|
|
40147
|
+
/**
|
|
40148
|
+
* Lists all notes in an account, optionally filtered by folder, date, and limit.
|
|
40149
|
+
*
|
|
40150
|
+
* @param account - Account to list notes from (defaults to iCloud)
|
|
40151
|
+
* @param folder - Optional folder to filter by
|
|
40152
|
+
* @param modifiedSince - Optional ISO 8601 date string to filter notes modified on or after this date
|
|
40153
|
+
* @param limit - Optional maximum number of results to return (default: no limit)
|
|
40154
|
+
* @returns Array of note titles
|
|
40155
|
+
*/
|
|
40156
|
+
listNotes(account, folder, modifiedSince, limit) {
|
|
40157
|
+
return this.listNotesCore(account, folder, modifiedSince, limit).map((ref) => ref.title);
|
|
40158
|
+
}
|
|
40159
|
+
/**
|
|
40160
|
+
* Lists all notes in an account, optionally filtered by folder, date, and
|
|
40161
|
+
* limit — same filtering semantics as `listNotes()`, but returns each
|
|
40162
|
+
* note's id alongside its title. Prefer this over `listNotes()` when the
|
|
40163
|
+
* caller needs to resolve notes by identity afterward: re-resolving by
|
|
40164
|
+
* title is unsafe when titles are duplicated (AppleScript's `note "<name>"`
|
|
40165
|
+
* specifier resolves ambiguously to the same one note every time — see
|
|
40166
|
+
* the fix in exportNotesAsJson for the failure mode this avoids).
|
|
40167
|
+
*
|
|
40168
|
+
* @returns Array of { title, id } pairs, deduplicated by id
|
|
40169
|
+
*/
|
|
40170
|
+
listNoteRefs(account, folder, modifiedSince, limit) {
|
|
40171
|
+
return this.listNotesCore(account, folder, modifiedSince, limit);
|
|
40163
40172
|
}
|
|
40164
40173
|
/**
|
|
40165
40174
|
* Lists all shared (collaborative) notes across all accounts.
|
|
@@ -42909,7 +42918,7 @@ registerTool(
|
|
|
42909
42918
|
registerTool(
|
|
42910
42919
|
"list-notes",
|
|
42911
42920
|
{
|
|
42912
|
-
description: "Use when: enumerating notes in an account or folder; supports modifiedSince and limit for large collections.\nReturns: note
|
|
42921
|
+
description: "Use when: enumerating notes in an account or folder; supports modifiedSince and limit for large collections.\nReturns: each note's title and id (ids are safe to use for follow-up reads/edits even when titles are duplicated \u2014 see search-notes for keyword-based lookup instead).\nDo not use when: you need content (get-note-content).\nNote: warns if iCloud sync is active and results may be partial.",
|
|
42913
42922
|
inputSchema: {
|
|
42914
42923
|
account: external_exports.string().max(MAX.ACCOUNT).optional().describe("Account to list notes from"),
|
|
42915
42924
|
folder: external_exports.string().max(MAX.FOLDER).optional().describe("Filter to specific folder"),
|
|
@@ -42919,7 +42928,7 @@ registerTool(
|
|
|
42919
42928
|
limit: external_exports.number().int().positive().optional().describe("Maximum number of notes to return")
|
|
42920
42929
|
},
|
|
42921
42930
|
outputSchema: {
|
|
42922
|
-
notes: external_exports.array(external_exports.string()).optional(),
|
|
42931
|
+
notes: external_exports.array(external_exports.object({ title: external_exports.string(), id: external_exports.string() })).optional(),
|
|
42923
42932
|
count: external_exports.number().optional()
|
|
42924
42933
|
}
|
|
42925
42934
|
},
|
|
@@ -42930,7 +42939,7 @@ registerTool(
|
|
|
42930
42939
|
syncInterference
|
|
42931
42940
|
} = withSyncAwarenessSync(
|
|
42932
42941
|
"list-notes",
|
|
42933
|
-
() => notesManager.
|
|
42942
|
+
() => notesManager.listNoteRefs(account, folder, modifiedSince, limit)
|
|
42934
42943
|
);
|
|
42935
42944
|
const location = folder ? ` in folder "${folder}"` : "";
|
|
42936
42945
|
const acct = account ? ` (${account})` : "";
|
|
@@ -42952,7 +42961,7 @@ ${syncWarnings.join(" ")}` : "";
|
|
|
42952
42961
|
count: 0
|
|
42953
42962
|
});
|
|
42954
42963
|
}
|
|
42955
|
-
const noteList = notes.map((
|
|
42964
|
+
const noteList = notes.map((n) => ` - ${n.title} [id: ${n.id}]`).join("\n");
|
|
42956
42965
|
return successResponse(
|
|
42957
42966
|
`Found ${notes.length} notes${location}${acct}${dateInfo}${limitInfo}:
|
|
42958
42967
|
${noteList}${syncNote}`,
|
package/package.json
CHANGED