@agenticmail/mcp 0.7.5 → 0.7.7

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/dist/index.js +68 -13
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -22615,7 +22615,7 @@ async function apiRequest(method, path, body, useMasterKey = false, timeoutMs =
22615
22615
  var toolDefinitions = [
22616
22616
  {
22617
22617
  name: "send_email",
22618
- description: "Send an email from the agent's mailbox. Supports multiple recipients on To and CC (comma-separated). This is the PRIMARY primitive for multi-agent coordination: kick off a thread with all participants on CC, and every local recipient is woken automatically. Each woken agent reads the thread, decides whose turn it is, and either reply-all's to contribute or stays silent. External emails are scanned for sensitive content; HIGH severity detections are BLOCKED for owner approval. You CANNOT bypass the outbound guard.",
22618
+ description: "Send an email from the agent's mailbox. Supports multiple recipients on To and CC (comma-separated). This is the PRIMARY primitive for multi-agent coordination: kick off a thread with all participants on CC, and every local recipient is woken automatically \u2014 UNLESS you set `wake` to limit the wake-up to specific agents. Use `wake` aggressively on large threads: 15 agents on CC \xD7 every reply burns 15 Claude turns per round if every recipient wakes. Naming the single next actor cuts that to one. External emails are scanned for sensitive content; HIGH severity detections are BLOCKED for owner approval. You CANNOT bypass the outbound guard.",
22619
22619
  inputSchema: {
22620
22620
  type: "object",
22621
22621
  properties: {
@@ -22623,7 +22623,12 @@ var toolDefinitions = [
22623
22623
  subject: { type: "string", description: "Email subject line" },
22624
22624
  text: { type: "string", description: "Plain text body" },
22625
22625
  html: { type: "string", description: "HTML body (optional)" },
22626
- cc: { type: "string", description: 'CC recipients \u2014 the team. Comma-separated, e.g. "vesper@localhost, orion@localhost". Every local @localhost recipient is auto-woken when this email lands.' },
22626
+ cc: { type: "string", description: 'CC recipients \u2014 the team. Comma-separated, e.g. "vesper@localhost, orion@localhost". Every local @localhost recipient is auto-woken when this email lands UNLESS you also pass `wake` to restrict.' },
22627
+ wake: {
22628
+ type: "array",
22629
+ items: { type: "string" },
22630
+ description: 'Optional. Names (or @localhost addresses) of the agents the dispatcher should give a Claude turn to when this mail lands. CC\'d agents NOT in this list still receive the email but get no Claude turn \u2014 they will see it the next time someone explicitly wakes them or they check their inbox. Use this to scope cost on large threads: send to 15 agents but wake only the 1 or 2 who need to act next. Pass an empty array `[]` for "deliver silently \u2014 wake nobody". Omit entirely to keep the default "wake everyone CC\'d" behaviour.'
22631
+ },
22627
22632
  inReplyTo: { type: "string", description: "Message-ID to reply to (optional)" },
22628
22633
  references: {
22629
22634
  type: "array",
@@ -22711,27 +22716,37 @@ var toolDefinitions = [
22711
22716
  },
22712
22717
  {
22713
22718
  name: "reply_email",
22714
- description: "Reply to an email. Fetches the original message, auto-fills To, Subject (Re:), In-Reply-To, and References, then sends with quoted body. **For multi-agent thread coordination, pass `replyAll: true`** so every CC'd participant sees your contribution and stays in context \u2014 that is how the thread-as-workspace pattern works. Outbound guard applies \u2014 HIGH severity content is held for review.",
22719
+ description: "Reply to an email. Fetches the original message, auto-fills To, Subject (Re:), In-Reply-To, and References, then sends with quoted body. **For multi-agent thread coordination, pass `replyAll: true`** so every CC'd participant sees your contribution and stays in context \u2014 that is how the thread-as-workspace pattern works. **Pass `wake` to name only the next actor(s)** so the dispatcher gives a Claude turn only to them; everyone else still receives the mail but stays asleep. Outbound guard applies \u2014 HIGH severity content is held for review.",
22715
22720
  inputSchema: {
22716
22721
  type: "object",
22717
22722
  properties: {
22718
22723
  uid: { type: "number", description: "UID of the email to reply to" },
22719
22724
  text: { type: "string", description: "Your reply text" },
22720
22725
  html: { type: "string", description: "HTML reply (optional)" },
22721
- replyAll: { type: "boolean", description: "Reply to all recipients (default: false)" }
22726
+ replyAll: { type: "boolean", description: "Reply to all recipients (default: false)" },
22727
+ wake: {
22728
+ type: "array",
22729
+ items: { type: "string" },
22730
+ description: "Optional. Names of the agents who should get a Claude turn from the dispatcher when this reply lands. CC'd agents NOT in this list still receive the email but stay asleep \u2014 saves significant tokens on large threads. Pass `[]` to deliver silently. Omit to wake everyone CC'd."
22731
+ }
22722
22732
  },
22723
22733
  required: ["uid", "text"]
22724
22734
  }
22725
22735
  },
22726
22736
  {
22727
22737
  name: "forward_email",
22728
- description: "Forward an email to another recipient. Outbound guard applies \u2014 HIGH severity content is held for review.",
22738
+ description: "Forward an email to another recipient. Outbound guard applies \u2014 HIGH severity content is held for review. Pass `wake` to limit which local recipients get a Claude turn from the dispatcher when this forward lands.",
22729
22739
  inputSchema: {
22730
22740
  type: "object",
22731
22741
  properties: {
22732
22742
  uid: { type: "number", description: "UID of the email to forward" },
22733
22743
  to: { type: "string", description: "Recipient to forward to" },
22734
- text: { type: "string", description: "Additional message (optional)" }
22744
+ text: { type: "string", description: "Additional message (optional)" },
22745
+ wake: {
22746
+ type: "array",
22747
+ items: { type: "string" },
22748
+ description: "Optional. Names of the agents who should get a Claude turn when the forward lands. Pass `[]` to deliver silently. Omit to wake everyone CC'd."
22749
+ }
22735
22750
  },
22736
22751
  required: ["uid", "to"]
22737
22752
  }
@@ -22832,7 +22847,7 @@ var toolDefinitions = [
22832
22847
  },
22833
22848
  {
22834
22849
  name: "manage_drafts",
22835
- description: "List, create, update, send, or delete drafts",
22850
+ description: "List, create, update, send, or delete drafts. On send, you can pass `wake` to limit which local recipients get a Claude turn \u2014 same semantics as send_email.",
22836
22851
  inputSchema: {
22837
22852
  type: "object",
22838
22853
  properties: {
@@ -22840,7 +22855,12 @@ var toolDefinitions = [
22840
22855
  id: { type: "string", description: "Draft ID (for update/send/delete)" },
22841
22856
  to: { type: "string", description: "Recipient (for create/update)" },
22842
22857
  subject: { type: "string", description: "Subject (for create/update)" },
22843
- text: { type: "string", description: "Body text (for create/update)" }
22858
+ text: { type: "string", description: "Body text (for create/update)" },
22859
+ wake: {
22860
+ type: "array",
22861
+ items: { type: "string" },
22862
+ description: "Optional, for action=send. Names of the agents who should get a Claude turn when the drafted mail lands. Pass `[]` to deliver silently. Omit to wake everyone CC'd."
22863
+ }
22844
22864
  },
22845
22865
  required: ["action"]
22846
22866
  }
@@ -23197,7 +23217,12 @@ var toolDefinitions = [
23197
23217
  to: { type: "string", description: "Recipient email" },
23198
23218
  variables: { type: "object", description: 'Variables to substitute: { name: "Alice" }' },
23199
23219
  cc: { type: "string", description: "CC recipients" },
23200
- bcc: { type: "string", description: "BCC recipients" }
23220
+ bcc: { type: "string", description: "BCC recipients" },
23221
+ wake: {
23222
+ type: "array",
23223
+ items: { type: "string" },
23224
+ description: "Optional. Names of the agents who should get a Claude turn when this template-rendered mail lands. Pass `[]` to deliver silently. Omit to wake everyone CC'd."
23225
+ }
23201
23226
  },
23202
23227
  required: ["id", "to"]
23203
23228
  }
@@ -23585,6 +23610,9 @@ async function dispatchToolCall(name, args2, useMaster) {
23585
23610
  ...a.encoding ? { encoding: a.encoding } : {}
23586
23611
  }));
23587
23612
  }
23613
+ if (args2.wake !== void 0) {
23614
+ sendBody.wake = args2.wake;
23615
+ }
23588
23616
  const result = await apiRequest("POST", "/mail/send", sendBody);
23589
23617
  if (result?.blocked && result?.pendingId) {
23590
23618
  scheduleFollowUp(result.pendingId, String(args2.to), String(args2.subject || "(no subject)"), makePendingCheck(result.pendingId));
@@ -23718,6 +23746,9 @@ ${quotedBody}`;
23718
23746
  inReplyTo: original.messageId,
23719
23747
  references: refs
23720
23748
  };
23749
+ if (args2.wake !== void 0) {
23750
+ replySendBody.wake = args2.wake;
23751
+ }
23721
23752
  const sendResult = await apiRequest("POST", "/mail/send", replySendBody);
23722
23753
  if (sendResult?.blocked && sendResult?.pendingId) {
23723
23754
  scheduleFollowUp(sendResult.pendingId, to, String(replySendBody.subject || "(no subject)"), makePendingCheck(sendResult.pendingId));
@@ -23766,6 +23797,9 @@ ${orig.text || ""}`;
23766
23797
  encoding: "base64"
23767
23798
  }));
23768
23799
  }
23800
+ if (args2.wake !== void 0) {
23801
+ fwdSendBody.wake = args2.wake;
23802
+ }
23769
23803
  const fwdResult = await apiRequest("POST", "/mail/send", fwdSendBody);
23770
23804
  if (fwdResult?.blocked && fwdResult?.pendingId) {
23771
23805
  scheduleFollowUp(fwdResult.pendingId, String(args2.to), fwdSubject, makePendingCheck(fwdResult.pendingId));
@@ -23870,7 +23904,9 @@ ${lines.join("\n")}`;
23870
23904
  }
23871
23905
  if (args2.action === "send") {
23872
23906
  if (!args2.id) throw new Error("id is required");
23873
- const r = await apiRequest("POST", `/drafts/${args2.id}/send`);
23907
+ const draftSendBody = {};
23908
+ if (args2.wake !== void 0) draftSendBody.wake = args2.wake;
23909
+ const r = await apiRequest("POST", `/drafts/${args2.id}/send`, draftSendBody);
23874
23910
  return `Draft sent. Message ID: ${r?.messageId ?? "unknown"}`;
23875
23911
  }
23876
23912
  if (args2.action === "delete") {
@@ -24476,12 +24512,14 @@ ${lines.join("\n\n---\n\n")}`;
24476
24512
  ${lines.join("\n")}`;
24477
24513
  }
24478
24514
  case "template_send": {
24479
- const result = await apiRequest("POST", `/templates/${args2.id}/send`, {
24515
+ const templateBody = {
24480
24516
  to: args2.to,
24481
24517
  variables: args2.variables,
24482
24518
  cc: args2.cc,
24483
24519
  bcc: args2.bcc
24484
- });
24520
+ };
24521
+ if (args2.wake !== void 0) templateBody.wake = args2.wake;
24522
+ const result = await apiRequest("POST", `/templates/${args2.id}/send`, templateBody);
24485
24523
  return `Template email sent. Message ID: ${result?.messageId ?? "unknown"}`;
24486
24524
  }
24487
24525
  case "manage_rules": {
@@ -25118,6 +25156,7 @@ var SERVER_INSTRUCTIONS = [
25118
25156
  ' to: "vesper@localhost", // primary owner of step 1',
25119
25157
  ' cc: "orion@localhost, claudecode@localhost", // teammates + yourself',
25120
25158
  ' subject: "Build a small terminal game",',
25159
+ ' wake: ["vesper"], // only Vesper gets a Claude turn',
25121
25160
  " text: [",
25122
25161
  ' "Team \u2014",',
25123
25162
  ' "",',
@@ -25130,6 +25169,14 @@ var SERVER_INSTRUCTIONS = [
25130
25169
  ' ].join("\\n"),',
25131
25170
  " })",
25132
25171
  "",
25172
+ " The `wake` parameter is the SINGLE BIGGEST TOKEN SAVER on large threads.",
25173
+ " Without it, every CC'd recipient burns one Claude turn deciding whether",
25174
+ " it is their turn. With it, only the named agents get a turn \u2014 the rest",
25175
+ " receive the mail in their inbox but stay asleep until you (or another",
25176
+ " agent) explicitly names them in a later `wake` list. Pass `wake: []`",
25177
+ ' for "deliver silently \u2014 wake nobody". Omit `wake` entirely to keep the',
25178
+ ` old "wake every CC'd agent" behaviour (backwards compatible).`,
25179
+ "",
25133
25180
  " The mail server pushes a wake-up to every local recipient simultaneously.",
25134
25181
  " Each agent reads the thread, decides if it is THEIR turn, and either",
25135
25182
  " reply-all's to contribute or stays silent. Vesper goes first because she",
@@ -25149,7 +25196,15 @@ var SERVER_INSTRUCTIONS = [
25149
25196
  " To unblock a stuck agent or change direction, just reply-all into the",
25150
25197
  " same thread.",
25151
25198
  "",
25152
- '4. Done when the last hand-off (or an explicit "complete" message) lands',
25199
+ "4. **Close the thread when work is complete.** Send a wrap-up reply",
25200
+ " with one of these markers in the subject: `[FINAL]`, `[DONE]`,",
25201
+ " `[CLOSED]`, or `[WRAP]`. The dispatcher honours those markers and",
25202
+ " stops waking workers on any further replies to that thread. Without",
25203
+ " this, the cascade can keep firing as agents critique each other's",
25204
+ " work even after the deliverables are in. Add the marker once, the",
25205
+ " thread is sealed.",
25206
+ "",
25207
+ '5. Done when the last hand-off (or an explicit "complete" message) lands',
25153
25208
  " in your inbox. Show the result to the user.",
25154
25209
  "",
25155
25210
  "Why this is right:",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenticmail/mcp",
3
- "version": "0.7.5",
3
+ "version": "0.7.7",
4
4
  "mcpName": "io.github.agenticmail/mcp",
5
5
  "description": "MCP server for AgenticMail — give any AI client real email and SMS capabilities",
6
6
  "type": "module",