apple-mail-mcp 2.19.7 → 2.19.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 +1 -0
- package/build/cli.js +1 -0
- package/build/index.js +27 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -226,6 +226,7 @@ Search for messages matching criteria. Searches all accounts by default.
|
|
|
226
226
|
| Parameter | Type | Required | Description |
|
|
227
227
|
|-----------|------|----------|-------------|
|
|
228
228
|
| `query` | string | No | Text to search in subject/sender |
|
|
229
|
+
| `body` | string | No | Text to search in the message body. IMAP backend only (server-side `BODY` search); AppleScript-only accounts are reported as not searched |
|
|
229
230
|
| `from` | string | No | Filter by sender email address |
|
|
230
231
|
| `subject` | string | No | Filter by subject line |
|
|
231
232
|
| `mailbox` | string | No | Mailbox to search in (omit to search all mailboxes) |
|
package/build/cli.js
CHANGED
|
@@ -58302,6 +58302,7 @@ async function resolveMailboxPath(client, mailbox, _mode) {
|
|
|
58302
58302
|
function buildCriteria(a, listMode) {
|
|
58303
58303
|
const c = {};
|
|
58304
58304
|
if (a.query) c.or = [{ subject: a.query }, { from: a.query }];
|
|
58305
|
+
if (a.body) c.body = a.body;
|
|
58305
58306
|
if (a.from) c.from = a.from;
|
|
58306
58307
|
if (a.subject) c.subject = a.subject;
|
|
58307
58308
|
if (a.isRead === true) c.seen = true;
|
package/build/index.js
CHANGED
|
@@ -65631,6 +65631,7 @@ async function resolveMailboxPath(client, mailbox, _mode) {
|
|
|
65631
65631
|
function buildCriteria(a, listMode) {
|
|
65632
65632
|
const c = {};
|
|
65633
65633
|
if (a.query) c.or = [{ subject: a.query }, { from: a.query }];
|
|
65634
|
+
if (a.body) c.body = a.body;
|
|
65634
65635
|
if (a.from) c.from = a.from;
|
|
65635
65636
|
if (a.subject) c.subject = a.subject;
|
|
65636
65637
|
if (a.isRead === true) c.seen = true;
|
|
@@ -84304,7 +84305,7 @@ ${indent}end try${this.sanitizeFragment("_uacct", indent)}${this.sanitizeFragmen
|
|
|
84304
84305
|
`;
|
|
84305
84306
|
}
|
|
84306
84307
|
const script = buildAppLevelScript(sendCommand);
|
|
84307
|
-
const result = executeAppleScript(script, { timeoutMs: 6e4, maxRetries:
|
|
84308
|
+
const result = executeAppleScript(script, { timeoutMs: 6e4, maxRetries: 1 });
|
|
84308
84309
|
if (!result.success) {
|
|
84309
84310
|
console.error(`Failed to send email: ${result.error}`);
|
|
84310
84311
|
return false;
|
|
@@ -84433,7 +84434,7 @@ ${indent}end try${this.sanitizeFragment("_uacct", indent)}${this.sanitizeFragmen
|
|
|
84433
84434
|
`;
|
|
84434
84435
|
}
|
|
84435
84436
|
const script = buildAppLevelScript(draftCommand);
|
|
84436
|
-
const result = executeAppleScript(script, { timeoutMs: 6e4, maxRetries:
|
|
84437
|
+
const result = executeAppleScript(script, { timeoutMs: 6e4, maxRetries: 1 });
|
|
84437
84438
|
if (!result.success) {
|
|
84438
84439
|
console.error(`Failed to create draft: ${result.error}`);
|
|
84439
84440
|
return false;
|
|
@@ -87991,7 +87992,10 @@ registerTool(
|
|
|
87991
87992
|
{
|
|
87992
87993
|
description: "Use when: finding messages by query/sender/subject/date/read/flag filters and you need their ids for follow-up operations.\nReturns: matching messages with id, date, subject, sender, and read state (plus partial-coverage diagnostics when some mailboxes were skipped).\nDo not use when: you want a plain mailbox listing without filters (use list-messages), already have an id and want the body (use get-message), or want a whole conversation (use get-thread).\nPrefer this first to obtain the message ids that get-message/mark-as-read/delete-message/move-message and the batch tools require.",
|
|
87993
87994
|
inputSchema: {
|
|
87994
|
-
query: external_exports.string().optional().describe("Text to search for in subject
|
|
87995
|
+
query: external_exports.string().optional().describe("Text to search for in subject or sender"),
|
|
87996
|
+
body: external_exports.string().optional().describe(
|
|
87997
|
+
"Text to search for in the message body (server-side IMAP BODY search). Requires the IMAP backend for the account searched; AppleScript-only accounts cannot search bodies and are reported as not searched."
|
|
87998
|
+
),
|
|
87995
87999
|
from: external_exports.string().optional().describe(
|
|
87996
88000
|
"Filter by sender (substring match against the full sender string, i.e. display name + address \u2014 not an exact address match)"
|
|
87997
88001
|
),
|
|
@@ -88009,6 +88013,7 @@ registerTool(
|
|
|
88009
88013
|
withErrorHandling(
|
|
88010
88014
|
async ({
|
|
88011
88015
|
query,
|
|
88016
|
+
body,
|
|
88012
88017
|
mailbox,
|
|
88013
88018
|
account,
|
|
88014
88019
|
limit = 50,
|
|
@@ -88022,6 +88027,7 @@ registerTool(
|
|
|
88022
88027
|
if (shouldUseImap(account)) {
|
|
88023
88028
|
const imapArgs = {
|
|
88024
88029
|
query,
|
|
88030
|
+
body,
|
|
88025
88031
|
mailbox,
|
|
88026
88032
|
limit,
|
|
88027
88033
|
dateFrom,
|
|
@@ -88045,6 +88051,19 @@ registerTool(
|
|
|
88045
88051
|
mailManager.listAccounts(),
|
|
88046
88052
|
resolveImapConfigs()
|
|
88047
88053
|
);
|
|
88054
|
+
if (body) {
|
|
88055
|
+
const apple2 = {
|
|
88056
|
+
rows: [],
|
|
88057
|
+
diagnostics: {
|
|
88058
|
+
...emptyDiagnostics(),
|
|
88059
|
+
partial: appleScriptOnly.length > 0,
|
|
88060
|
+
notSearchedMailboxes: appleScriptOnly.map(
|
|
88061
|
+
(a) => `${a.name} (body search requires the IMAP backend)`
|
|
88062
|
+
)
|
|
88063
|
+
}
|
|
88064
|
+
};
|
|
88065
|
+
return mergedMessageResponse(fan, apple2, limit, "matched");
|
|
88066
|
+
}
|
|
88048
88067
|
const apple = appleScanForAccounts(
|
|
88049
88068
|
appleScriptOnly,
|
|
88050
88069
|
(acctName) => mailManager.searchMessagesWithDiagnostics(
|
|
@@ -88062,6 +88081,11 @@ registerTool(
|
|
|
88062
88081
|
);
|
|
88063
88082
|
return mergedMessageResponse(fan, apple, limit, "matched");
|
|
88064
88083
|
}
|
|
88084
|
+
if (body) {
|
|
88085
|
+
return errorResponse(
|
|
88086
|
+
`Body search requires the IMAP backend, which is not configured for ${account ? `account "${account}"` : "any account"}. Configure IMAP (see the IMAP backend section of the README) or search by query/subject/from instead.`
|
|
88087
|
+
);
|
|
88088
|
+
}
|
|
88065
88089
|
const { messages, diagnostics } = mailManager.searchMessagesWithDiagnostics(
|
|
88066
88090
|
query,
|
|
88067
88091
|
mailbox,
|
package/package.json
CHANGED