apple-mail-mcp 2.8.14 → 2.8.15

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.
Files changed (2) hide show
  1. package/build/index.js +7 -29
  2. package/package.json +1 -1
package/build/index.js CHANGED
@@ -78534,20 +78534,9 @@ var AppleMailManager = class {
78534
78534
  */
78535
78535
  getUnreadCount(mailbox, account) {
78536
78536
  const targetAccount = this.resolveAccount(account);
78537
- let command;
78538
- if (mailbox) {
78539
- const targetMailbox = this.resolveMailbox(mailbox, targetAccount);
78540
- const safeMailbox = escapeForAppleScript(targetMailbox);
78541
- command = `return unread count of mailbox "${safeMailbox}"`;
78542
- } else {
78543
- command = `
78544
- set total to 0
78545
- repeat with mb in mailboxes
78546
- set total to total + (unread count of mb)
78547
- end repeat
78548
- return total
78549
- `;
78550
- }
78537
+ const targetMailbox = this.resolveMailbox(mailbox || "INBOX", targetAccount);
78538
+ const safeMailbox = escapeForAppleScript(targetMailbox);
78539
+ const command = `return unread count of mailbox "${safeMailbox}"`;
78551
78540
  const script = buildAccountScopedScript(targetAccount, command);
78552
78541
  const result = executeAppleScript(script, { timeoutMs: 6e4 });
78553
78542
  if (!result.success) {
@@ -79815,19 +79804,8 @@ function imapUnreadCount(mailbox, deps = {}) {
79815
79804
  return useClient(
79816
79805
  deps,
79817
79806
  async (client) => {
79818
- if (mailbox) {
79819
- const s = await client.status(resolveMailboxPath(mailbox, "list"), { unseen: true });
79820
- return s.unseen ?? 0;
79821
- }
79822
- let total = 0;
79823
- for (const b of await client.list()) {
79824
- try {
79825
- const s = await client.status(b.path, { unseen: true });
79826
- total += s.unseen ?? 0;
79827
- } catch {
79828
- }
79829
- }
79830
- return total;
79807
+ const s = await client.status(resolveMailboxPath(mailbox, "list"), { unseen: true });
79808
+ return s.unseen ?? 0;
79831
79809
  },
79832
79810
  true
79833
79811
  );
@@ -82268,9 +82246,9 @@ ${mailboxList}`, structured);
82268
82246
  server.registerTool(
82269
82247
  "get-unread-count",
82270
82248
  {
82271
- description: "Use when: you only need the number of unread messages (optionally scoped to one mailbox and/or account), without listing the messages themselves.\nReturns: the unread count for the requested scope.\nDo not use when: you need the actual unread messages and their ids (use list-messages with unreadOnly, or search-messages with isRead=false) or broader totals (use get-mail-stats).",
82249
+ description: "Use when: you only need the number of unread messages \u2014 INBOX by default, or scoped to one mailbox and/or account \u2014 without listing the messages themselves.\nReturns: the unread count for the requested scope (INBOX when no mailbox is given).\nDo not use when: you need the actual unread messages and their ids (use list-messages with unreadOnly, or search-messages with isRead=false) or broader totals across every mailbox (use get-mail-stats).",
82272
82250
  inputSchema: {
82273
- mailbox: external_exports.string().optional().describe("Mailbox to check (default: all)"),
82251
+ mailbox: external_exports.string().optional().describe("Mailbox to check (default: INBOX)"),
82274
82252
  account: external_exports.string().optional().describe("Account to check")
82275
82253
  },
82276
82254
  outputSchema: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apple-mail-mcp",
3
- "version": "2.8.14",
3
+ "version": "2.8.15",
4
4
  "description": "MCP server for Apple Mail - read, search, send, and manage emails via Claude and other AI assistants",
5
5
  "type": "module",
6
6
  "main": "build/index.js",