apple-notes-mcp 2.6.8 → 2.6.9

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 CHANGED
@@ -211,7 +211,7 @@ Searches for notes by title or content.
211
211
  | `account` | string | No | Account to search in (defaults to iCloud) |
212
212
  | `folder` | string | No | Limit search to a specific folder (supports nested paths like `"Work/Clients"`) |
213
213
  | `modifiedSince` | string | No | ISO 8601 date string to filter notes modified on or after this date (e.g., `"2025-01-01"`) |
214
- | `limit` | number | No | Maximum number of results to return |
214
+ | `limit` | number | No | Maximum number of results to return. **Defaults to 50** — a broad query reads several properties per match via AppleScript (~200ms/note), so an unbounded search over hundreds of matches can exceed Notes' 30s timeout and return an error instead of results. Pass a higher value to see more; the applied limit (and whether it truncated the results) is disclosed in the response. |
215
215
 
216
216
  **Example - Search titles:**
217
217
  ```json
package/build/index.js CHANGED
@@ -41849,6 +41849,22 @@ function resolveUpdateResponseTitle(currentTitle, newTitle, format, newContent)
41849
41849
  return newTitle || currentTitle;
41850
41850
  }
41851
41851
 
41852
+ // src/utils/searchLimit.ts
41853
+ var DEFAULT_SEARCH_LIMIT = 50;
41854
+ function resolveSearchLimit(limit) {
41855
+ if (limit !== void 0 && Number.isFinite(limit) && limit > 0) {
41856
+ return Math.floor(limit);
41857
+ }
41858
+ return DEFAULT_SEARCH_LIMIT;
41859
+ }
41860
+ function describeSearchLimit(effectiveLimit, wasDefault, resultCount) {
41861
+ const info = ` (limit: ${effectiveLimit}${wasDefault ? ", default" : ""})`;
41862
+ const truncationNote = resultCount >= effectiveLimit ? `
41863
+
41864
+ \u2139\uFE0F Showing the first ${effectiveLimit}${wasDefault ? " (default limit)" : ""}; there may be more. Narrow the query, filter with \`folder\`/\`modifiedSince\`, or pass a higher \`limit\` to see additional matches.` : "";
41865
+ return { info, truncationNote };
41866
+ }
41867
+
41852
41868
  // src/tools/doctor.ts
41853
41869
  import { spawnSync } from "child_process";
41854
41870
  function runDoctor(manager) {
@@ -42130,7 +42146,9 @@ server.registerTool(
42130
42146
  modifiedSince: external_exports.string().max(64).optional().describe(
42131
42147
  "ISO 8601 date string to filter notes modified on or after this date (e.g., '2025-01-01'). Useful for searching only recent notes in large collections."
42132
42148
  ),
42133
- limit: external_exports.number().int().positive().optional().describe("Maximum number of results to return")
42149
+ limit: external_exports.number().int().positive().optional().describe(
42150
+ "Maximum number of results to return. Defaults to 50 \u2014 a broad query reads several properties per match via AppleScript, so an unbounded search can time out. Pass a higher value to see more; the applied limit is disclosed in the response."
42151
+ )
42134
42152
  },
42135
42153
  outputSchema: {
42136
42154
  notes: external_exports.array(external_exports.object({}).passthrough()).optional(),
@@ -42138,18 +42156,24 @@ server.registerTool(
42138
42156
  }
42139
42157
  },
42140
42158
  withErrorHandling(({ query, searchContent = false, account, folder, modifiedSince, limit }) => {
42159
+ const effectiveLimit = resolveSearchLimit(limit);
42160
+ const limitWasDefault = limit === void 0;
42141
42161
  const {
42142
42162
  result: notes,
42143
42163
  syncBefore,
42144
42164
  syncInterference
42145
42165
  } = withSyncAwarenessSync(
42146
42166
  "search-notes",
42147
- () => notesManager.searchNotes(query, searchContent, account, folder, modifiedSince, limit)
42167
+ () => notesManager.searchNotes(query, searchContent, account, folder, modifiedSince, effectiveLimit)
42148
42168
  );
42149
42169
  const searchType = searchContent ? "content" : "titles";
42150
42170
  const folderInfo = folder ? ` in folder "${folder}"` : "";
42151
42171
  const dateInfo = modifiedSince ? ` modified since ${modifiedSince}` : "";
42152
- const limitInfo = limit ? ` (limit: ${limit})` : "";
42172
+ const { info: limitInfo, truncationNote } = describeSearchLimit(
42173
+ effectiveLimit,
42174
+ limitWasDefault,
42175
+ notes.length
42176
+ );
42153
42177
  const syncWarnings = [];
42154
42178
  if (syncBefore.syncDetected) {
42155
42179
  syncWarnings.push(`\u26A0\uFE0F iCloud sync was active during search.`);
@@ -42177,7 +42201,7 @@ ${syncWarnings.join(" ")}` : "";
42177
42201
  }).join("\n");
42178
42202
  return successResponse(
42179
42203
  `Found ${notes.length} notes (searched ${searchType}${folderInfo}${dateInfo}${limitInfo}):
42180
- ${noteList}${syncNote}`,
42204
+ ${noteList}${truncationNote}${syncNote}`,
42181
42205
  { notes, count: notes.length }
42182
42206
  );
42183
42207
  }, "Error searching notes")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apple-notes-mcp",
3
- "version": "2.6.8",
3
+ "version": "2.6.9",
4
4
  "description": "MCP server for Apple Notes - create, search, update, and manage notes via Claude and other AI assistants",
5
5
  "type": "module",
6
6
  "main": "build/index.js",