@assistantmail/assistantmail-mcp 1.2.2 → 1.3.0
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 +12 -0
- package/package.json +1 -1
- package/src/index.js +68 -0
package/README.md
CHANGED
|
@@ -103,6 +103,7 @@ Mail API routes use a `mailboxId` (UUID), not an email address. Use `assistantma
|
|
|
103
103
|
| `assistantmail_list_messages` | List inbound and outbound messages for a mailbox. Supports `since` (ISO timestamp) and `limit` (max 100). |
|
|
104
104
|
| `assistantmail_get_message` | Fetch a single message including `textBody` and `htmlBody`. Bodies are only returned within the plan's retention window; `bodyExpired: true` is set if the window has elapsed. |
|
|
105
105
|
| `assistantmail_send_email` | Queue an outbound email. Requires `to`, `subject`, and at least one of `text` or `html`. |
|
|
106
|
+
| `assistantmail_reply_message` | Reply to an existing message. Requires `messageId` and at least one of `text` or `html`; recipients and subject are derived automatically. |
|
|
106
107
|
| `assistantmail_delete_messages` | Delete messages by `messageIds` array, or pass `deleteAll: true` to clear the mailbox. |
|
|
107
108
|
| `assistantmail_get_usage` | Get daily and monthly send quota usage for a mailbox. A `null` limit means unlimited. |
|
|
108
109
|
|
|
@@ -174,6 +175,17 @@ curl "$BASE/v1/mailboxes/<mailboxId>/messages" -H "x-api-key: $API_KEY"
|
|
|
174
175
|
}
|
|
175
176
|
```
|
|
176
177
|
|
|
178
|
+
```json
|
|
179
|
+
{
|
|
180
|
+
"tool": "assistantmail_reply_message",
|
|
181
|
+
"input": {
|
|
182
|
+
"mailboxId": "<uuid>",
|
|
183
|
+
"messageId": "<uuid>",
|
|
184
|
+
"text": "Thanks for the update."
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
177
189
|
If `ASSISTANT_MAIL_API_KEY` is set in the server environment, `apiKey` can be omitted from all tool inputs.
|
|
178
190
|
|
|
179
191
|
---
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -504,6 +504,74 @@ server.tool(
|
|
|
504
504
|
},
|
|
505
505
|
);
|
|
506
506
|
|
|
507
|
+
server.tool(
|
|
508
|
+
'assistantmail_reply_message',
|
|
509
|
+
'Replies to an existing message in a mailbox thread.',
|
|
510
|
+
{
|
|
511
|
+
mailboxId: z.string().min(1),
|
|
512
|
+
messageId: z.string().min(1),
|
|
513
|
+
text: z.string().optional(),
|
|
514
|
+
html: z.string().optional(),
|
|
515
|
+
apiKey: z.string().startsWith('amk_').optional(),
|
|
516
|
+
},
|
|
517
|
+
async ({ mailboxId, messageId, text, html, apiKey }) => {
|
|
518
|
+
if (!text && !html) {
|
|
519
|
+
return {
|
|
520
|
+
content: [
|
|
521
|
+
{
|
|
522
|
+
type: 'text',
|
|
523
|
+
text: 'assistantmail_reply_message failed: Provide at least one of text or html.',
|
|
524
|
+
},
|
|
525
|
+
],
|
|
526
|
+
isError: true,
|
|
527
|
+
};
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
try {
|
|
531
|
+
const result = await assistantMailPost(
|
|
532
|
+
`/v1/mailboxes/${mailboxId}/messages/${messageId}/reply`,
|
|
533
|
+
apiKey,
|
|
534
|
+
{ text, html },
|
|
535
|
+
);
|
|
536
|
+
const reply = result.data;
|
|
537
|
+
if (
|
|
538
|
+
!reply
|
|
539
|
+
|| typeof reply !== 'object'
|
|
540
|
+
|| typeof reply.messageId !== 'string'
|
|
541
|
+
|| typeof reply.status !== 'string'
|
|
542
|
+
|| typeof reply.inReplyTo !== 'string'
|
|
543
|
+
|| typeof reply.subject !== 'string'
|
|
544
|
+
) {
|
|
545
|
+
throw new Error('AssistantMail API returned an unexpected reply payload.');
|
|
546
|
+
}
|
|
547
|
+
return {
|
|
548
|
+
content: [
|
|
549
|
+
{
|
|
550
|
+
type: 'text',
|
|
551
|
+
text: `Queued reply for message ${messageId} in mailbox ${mailboxId}.`,
|
|
552
|
+
},
|
|
553
|
+
],
|
|
554
|
+
structuredContent: {
|
|
555
|
+
messageId: reply.messageId,
|
|
556
|
+
status: reply.status,
|
|
557
|
+
inReplyTo: reply.inReplyTo,
|
|
558
|
+
subject: reply.subject,
|
|
559
|
+
},
|
|
560
|
+
};
|
|
561
|
+
} catch (error) {
|
|
562
|
+
return {
|
|
563
|
+
content: [
|
|
564
|
+
{
|
|
565
|
+
type: 'text',
|
|
566
|
+
text: `assistantmail_reply_message failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
567
|
+
},
|
|
568
|
+
],
|
|
569
|
+
isError: true,
|
|
570
|
+
};
|
|
571
|
+
}
|
|
572
|
+
},
|
|
573
|
+
);
|
|
574
|
+
|
|
507
575
|
server.tool(
|
|
508
576
|
'assistantmail_delete_messages',
|
|
509
577
|
'Deletes messages from a mailbox by IDs or deletes all messages.',
|