@agenticmail/mcp 0.7.4 → 0.7.5

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 +49 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -22395,6 +22395,12 @@ var TOOL_SETS = {
22395
22395
  // back. Essential enough that paying its tokens at every spawn beats
22396
22396
  // making the agent discover it via request_tools.
22397
22397
  "wait_for_email",
22398
+ // check_activity is the dispatcher visibility primitive: see which
22399
+ // agents the dispatcher has woken right now (or in the last 2 min)
22400
+ // and how long they have been running. The host uses it to answer
22401
+ // "did the agent I just emailed actually start working?" without
22402
+ // having to wait for a reply or send an acknowledgment.
22403
+ "check_activity",
22398
22404
  "check_tasks"
22399
22405
  ],
22400
22406
  /** Less-common mail operations. */
@@ -23227,6 +23233,17 @@ var toolDefinitions = [
23227
23233
  required: ["action"]
23228
23234
  }
23229
23235
  },
23236
+ {
23237
+ name: "check_activity",
23238
+ description: "Check which agents are currently being woken by the dispatcher (right now or in the last 2 minutes). Use this when you sent mail to a teammate and want to know if they have actually started working, or to audit the live multi-agent state. Returns active workers with the agent name, what triggered the wake (mail UID + subject, or task id), how long they have been running, and a preview of the most recent finished work. Requires master key \u2014 the host session has it; subagents normally do not.",
23239
+ inputSchema: {
23240
+ type: "object",
23241
+ properties: {
23242
+ agent: { type: "string", description: "Filter to a specific agent by name (case-insensitive). Omit to see every active and recently-finished worker." },
23243
+ includeRecent: { type: "boolean", description: "Include workers that finished in the last ~2 minutes (default: true). Set false to see only currently-running workers." }
23244
+ }
23245
+ }
23246
+ },
23230
23247
  {
23231
23248
  name: "check_tasks",
23232
23249
  description: "Check for pending tasks assigned to you (or a specific agent) or tasks you assigned to others",
@@ -24519,6 +24536,38 @@ ${r.agents.map(
24519
24536
  }
24520
24537
  throw new Error("Invalid action. Use: list_inactive, cleanup, or set_persistent");
24521
24538
  }
24539
+ case "check_activity": {
24540
+ const r = await apiRequest("GET", "/dispatcher/activity", void 0, true);
24541
+ const filterAgent = typeof args2.agent === "string" ? args2.agent.toLowerCase() : "";
24542
+ const includeRecent = args2.includeRecent !== false;
24543
+ const matchesFilter = (w) => !filterAgent || (w.agentName ?? "").toLowerCase().includes(filterAgent);
24544
+ const activeList = Array.isArray(r?.active) ? r.active.filter(matchesFilter) : [];
24545
+ const recentList = includeRecent && Array.isArray(r?.recent) ? r.recent.filter(matchesFilter) : [];
24546
+ if (activeList.length === 0 && recentList.length === 0) {
24547
+ if (filterAgent) return `No dispatcher activity for "${args2.agent}" right now or in the last 2 minutes. Either the agent has not been woken on this thread yet, the dispatcher is not running, or mail to them is still in flight.`;
24548
+ return "No dispatcher activity right now or in the last 2 minutes. If you just sent mail and expected an agent to wake, give it a moment \u2014 the dispatcher subscribes to /system/events for sub-second wake. If nothing happens for 30s, check that the dispatcher process is running (`pm2 list`) and that the recipient is a real local agent (`list_agents`).";
24549
+ }
24550
+ const fmt = (w, prefix) => {
24551
+ const dur = w.durationMs ? `${(w.durationMs / 1e3).toFixed(1)}s` : "?";
24552
+ const trig = w.trigger?.subject ? ` \u2014 ${String(w.trigger.subject).slice(0, 60)}` : w.trigger?.taskId ? ` \u2014 task ${String(w.trigger.taskId).slice(0, 8)}` : "";
24553
+ const from = w.trigger?.from ? ` (from ${w.trigger.from})` : "";
24554
+ const preview = w.resultPreview ? `
24555
+ \u2192 ${String(w.resultPreview).slice(0, 140).replace(/\s+/g, " ").trim()}` : "";
24556
+ const status = w.endedAtMs ? w.ok === false ? "failed" : "finished" : "running";
24557
+ return ` ${prefix} ${w.agentName} [${w.kind}] ${status} ${dur}${trig}${from}${preview}`;
24558
+ };
24559
+ const lines = [];
24560
+ if (activeList.length > 0) {
24561
+ lines.push(`Active workers (${activeList.length}):`);
24562
+ for (const w of activeList) lines.push(fmt(w, "\u25CF"));
24563
+ }
24564
+ if (recentList.length > 0) {
24565
+ if (lines.length > 0) lines.push("");
24566
+ lines.push(`Recently finished (last 2 min, ${recentList.length}):`);
24567
+ for (const w of recentList) lines.push(fmt(w, "\u25CB"));
24568
+ }
24569
+ return lines.join("\n");
24570
+ }
24522
24571
  case "check_tasks": {
24523
24572
  let endpoint = args2.direction === "outgoing" ? "/tasks/assigned" : "/tasks/pending";
24524
24573
  if (args2.direction !== "outgoing" && args2.assignee) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenticmail/mcp",
3
- "version": "0.7.4",
3
+ "version": "0.7.5",
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",