MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / listPendingMessages

Method listPendingMessages

mcp/src/client.ts:278–294  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

276 // filter on the status field. Searches across every owned agent when no
277 // default address is pinned so the queue is visible without a default.
278 async listPendingMessages(): Promise<MessageSummaryView[]> {
279 const addresses = this.agentEmail
280 ? [this.agentEmail]
281 : (await this.listAgents()).map((a) => a.email);
282 const out: MessageSummaryView[] = [];
283 for (const address of addresses) {
284 const rows = await this.sdk.messages
285 .list(address, { direction: "outbound" })
286 .toArray({ limit: DEFAULT_LIST_LIMIT });
287 for (const r of rows) {
288 // Held drafts carry the review-hold lifecycle in review_status
289 // (read_status is the inbox read-state, "" for outbound). MSG-1.
290 if (r.reviewStatus === PENDING_REVIEW_STATUS) out.push(r);
291 }
292 }
293 return out;
294 }
295
296 // Resolve the owning agent of a pending OUTBOUND draft by scanning the queue.
297 // get_pending_message is a RUNTIME-tier tool (agent-visible), so it must hit

Callers 1

registerReviewToolsFunction · 0.80

Calls 3

listAgentsMethod · 0.95
toArrayMethod · 0.80
listMethod · 0.45

Tested by

no test coverage detected