Agent Email
v0.6.1Local email connectivity for AI agents — read, draft, send, and organize Outlook mail via MCP
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
list_emails
List recent emails with filtering by unread status, folder, sender, and limit. Use offset for pagination. A row with `isDraft: true` is an unsent draft — it has NOT been sent, and its `receivedAt` is provider-supplied metadata, not evidence of delivery. Never describe such a row as a sent, delivered, or received email.
| Parameter | Type | Description |
|---|---|---|
folder | string | |
limit | number | |
mailbox | string | |
offset | number | |
unread | boolean |
read_email
Read the full content of an email by ID, transformed to token-efficient markdown. When the response has `isDraft: true` the message is an unsent draft — it has NOT been sent, and `receivedAt` is provider-supplied metadata, not evidence of delivery; never describe it as a sent, delivered, or received email. Set format to 'html' to get the raw body HTML instead of markdown — use this when you need to preserve inline styling (colour, background-colour, underline, strikethrough) that the markdown conversion discards, e.g. to change one sentence of a formatted body and leave the rest alone. Raw…
| Parameter | Type | Description |
|---|---|---|
id * | string | |
format | string | |
mailbox | string | |
strip_quoted_history | boolean | |
strip_signatures | boolean |
search_emails
Search emails using full-text query across one or all mailboxes. Use offset for pagination. Results include unsent drafts: a row with `isDraft: true` has NOT been sent — its `receivedAt` is provider-supplied metadata, not evidence of delivery. Never describe such a row as a sent, delivered, or received email.
| Parameter | Type | Description |
|---|---|---|
query * | string | |
limit | number | |
mailbox | string | null | |
offset | number |
get_mailbox_status
Get mailbox connection status, unread count, and warnings
| Parameter | Type | Description |
|---|---|---|
mailbox | string |
list_mailboxes
List every configured mailbox: its logical `name` (pass this as the `mailbox` argument to other tools), its `emailAddress`, provider, connection status, and which one is the default. Reports mailboxes that failed to authenticate too, so it stays useful for diagnosing a broken setup.
get_thread
Retrieve all messages in a conversation thread by message ID. A thread can end with an unsent draft reply: a message with `isDraft: true` has NOT been sent, so it is not a sent reply — though earlier sent replies from the same author may exist elsewhere in the thread. Never describe such a message as a sent, delivered, or received email.
| Parameter | Type | Description |
|---|---|---|
message_id * | string | |
mailbox | string |
send_email
Compose and send a new email. Gated by send allowlist. Draft mode bypasses allowlist. If a send fails with SEND_STATUS_UNKNOWN, the message may already have been delivered; do not resend without checking Sent Items. An identical send repeated within the duplicate window is refused with a DUPLICATE_SEND_* code instead of delivering twice; pass allow_duplicate: true only when a human has decided to send the same message again.
| Parameter | Type | Description |
|---|---|---|
allow_duplicate | boolean | Bypass the duplicate-delivery guard for this request. The guard refuses an identical delivery repeated within the duplicate window (default 15 minutes) so a replayed tool call cannot send the same mes… |
attachments | array | Files to attach, maximum 25 MB per file. Each entry takes a sandboxed `path` or inline `base64`. |
body | string | |
body_file | string | Path to a .md/.html/.txt file to use as the body. Sandboxed like attachment paths: relative paths resolve against the working directory only; files in an AGENT_EMAIL_ALLOWED_DIRS root must be given as… |
cc | array | |
draft | boolean | |
force_black | boolean | Wrap rendered HTML in a force-black div so Outlook dark mode does not hide the text. Default true. Ignored when format is "text". |
format | string | Body format. 'markdown' (default) renders via GFM with line-break preservation; 'html' is passthrough; 'text' sends as plain text. |
list_style | string | Ordered-list shaping for markdown bodies. 'default' (the default) is standard markdown rendering. 'outlook' emits numbered items that carry sub-paragraphs (for example lettered points a., b. under eac… |
mailbox | string | |
scheduled_send_at | string | Future ISO 8601 delivery time with an explicit timezone. Accepted values are normalized to UTC. |
subject | string | |
to |
reply_to_email
Reply to an email within an existing thread. Default reply_all=true cc's the original thread; pass reply_all=false to reply only to the sender. Send path validates all effective recipients against the send allowlist; draft path bypasses. If a send fails with SEND_STATUS_UNKNOWN, the message may already have been delivered; do not resend without checking Sent Items. An identical reply repeated within the duplicate window is refused with a DUPLICATE_SEND_* code instead of delivering twice; pass allow_duplicate: true only when a human has decided to send the same reply again.
| Parameter | Type | Description |
|---|---|---|
body * | string | |
message_id * | string | |
allow_duplicate | boolean | Bypass the duplicate-delivery guard for this request. The guard refuses an identical delivery repeated within the duplicate window (default 15 minutes) so a replayed tool call cannot send the same mes… |
attachments | array | Files to attach, maximum 25 MB per file. Each entry takes a sandboxed `path` or inline `base64`. |
cc | array | |
draft | boolean | |
force_black | boolean | Wrap rendered HTML in a force-black div so Outlook dark mode does not hide the text. Default true. |
format | string | Body format. 'markdown' (default) renders via GFM with line-break preservation; 'html' is passthrough; 'text' sends as plain text. |
include_quoted | boolean | Include provider-assembled quoted history in preview.bodyHtml for draft replies. This affects only the preview, never the stored or sent body. |
list_style | string | Ordered-list shaping for markdown bodies. 'default' (the default) is standard markdown rendering. 'outlook' emits numbered items that carry sub-paragraphs (for example lettered points a., b. under eac… |
mailbox | string | |
reply_all | boolean | When false, reply only to the original sender. Default true preserves reply-all behavior (cc the original thread). |
create_draft
Create an email draft with to/cc/bcc recipients and an optional verified from address. Supports body_file with YAML frontmatter (to, cc, bcc, subject, reply_to, forward_of, format, force_black, list_style). Use forward_of for a forward retaining the original content and attachments, or reply_to for threaded reply drafts, where to and subject are derived from the parent message and may be omitted; pass reply_all=false with reply_to to draft a sender-only reply. For numbered items with lettered sub-paragraphs that someone will edit in Outlook, pass list_style: 'outlook' so indenting a sub-paragr…
| Parameter | Type | Description |
|---|---|---|
attachments | array | Files to attach, maximum 25 MB per file. Each entry takes a sandboxed `path` or inline `base64`. |
bcc | array | Bcc recipient address(es). With reply_to set, these are added to the reply and removed from the provider-derived To/Cc, so a thread participant can be moved to Bcc. An address may not appear on both b… |
body | string | |
body_file | string | Path to a .md/.html/.txt file to use as the body. Sandboxed like attachment paths: relative paths resolve against the working directory only; files in an AGENT_EMAIL_ALLOWED_DIRS root must be given as… |
cc | array | |
force_black | boolean | Wrap rendered HTML in a force-black div so Outlook dark mode does not hide the text. Default true. |
format | string | Body format. 'markdown' (default) renders via GFM with line-break preservation; 'html' is passthrough; 'text' sends as plain text. |
forward_of | string | Message to forward, retaining original content and attachments. Requires explicit to recipients. Mutually exclusive with reply_to. |
from | string | Mailbox primary address or verified send-as alias. Fails closed if the provider cannot verify it. |
include_quoted | boolean | Include provider-assembled quoted history in preview.bodyHtml. This affects only the preview, never the stored or sent body. |
list_style | string | Ordered-list shaping for markdown bodies. 'default' (the default) is standard markdown rendering. 'outlook' emits numbered items that carry sub-paragraphs (for example lettered points a., b. under eac… |
mailbox | string | |
reply_all | boolean | Only relevant when reply_to is set. When false, the draft replies only to the original sender. Default true preserves reply-all behavior (cc the original thread). |
reply_to | string | |
subject | string | |
to | Recipient address(es). Required for a new draft; optional with reply_to set, where recipients are derived from the parent message. When supplied alongside reply_to it replaces the provider-derived To… |
send_draft
Send a previously created draft. Enforces send allowlist before sending. Rate-limited. If a send fails with SEND_STATUS_UNKNOWN, the message may already have been delivered; do not resend without checking Sent Items. Sending the same draft id twice within the duplicate window is refused with a DUPLICATE_SEND_* code instead of delivering twice; pass allow_duplicate: true only when a human has decided to send it again.
| Parameter | Type | Description |
|---|---|---|
draft_id * | string | |
allow_duplicate | boolean | Bypass the duplicate-delivery guard for this request. The guard refuses an identical delivery repeated within the duplicate window (default 15 minutes) so a replayed tool call cannot send the same mes… |
mailbox | string | |
scheduled_send_at | string | Future ISO 8601 delivery time with an explicit timezone. Accepted values are normalized to UTC. |
update_draft
Update a draft email. Body edits are refused for reply drafts; non-reply body edits require replace_body=true and replace the body wholesale. Subject, recipients (to/cc/bcc), and attachments remain editable. Allowlist is enforced at send_draft time, not here.
| Parameter | Type | Description |
|---|---|---|
draft_id * | string | Draft to update. On Gmail either the draft id (r…) or the id of the draft's message, as list_emails(folder: "drafts") reports it. |
attachments | array | Files to attach, maximum 25 MB per file. Omit to preserve the draft's existing attachments; provide an array (possibly empty) to replace them entirely. |
bcc | array | Bcc recipient address(es). Replaces the draft's Bcc line; pass [] to clear it, omit to keep it. An address may not appear on both bcc and to/cc. The send allowlist applies to bcc at send_draft time. |
body | string | |
body_file | string | Path to a .md/.html/.txt file to use as the body. Sandboxed like attachment paths: relative paths resolve against the working directory only; files in an AGENT_EMAIL_ALLOWED_DIRS root must be given as… |
cc | array | |
force_black | boolean | Wrap rendered HTML in a force-black div so Outlook dark mode does not hide the text. Default true. |
format | string | Body format. 'markdown' (default) renders via GFM with line-break preservation; 'html' is passthrough; 'text' sends as plain text. |
from | string | Mailbox primary address or verified send-as alias. Fails closed if the provider cannot verify it. |
include_quoted | boolean | Include provider-assembled quoted history in preview.bodyHtml. This affects only the preview, never the stored or sent body. |
list_style | string | Ordered-list shaping for markdown bodies. 'default' (the default) is standard markdown rendering. 'outlook' emits numbered items that carry sub-paragraphs (for example lettered points a., b. under eac… |
mailbox | string | |
replace_body | boolean | Required as true to replace the body of a non-reply draft wholesale. Reply draft bodies cannot be edited; create a new draft instead. |
subject | string | |
to |
cancel_scheduled_send
Delete a verified future-deferred draft to cancel its pending send. Delivery can race deletion; success does not recall mail already delivered.
| Parameter | Type | Description |
|---|---|---|
message_id * | string | |
mailbox | string |
list_scheduled_sends
List pending provider-held scheduled sends for a mailbox
| Parameter | Type | Description |
|---|---|---|
mailbox | string |
list_attachments
List attachments for a specific email message
| Parameter | Type | Description |
|---|---|---|
message_id * | string | |
mailbox | string |
download_attachment
Download a single attachment. By default returns inline base64 (max_size_mb default 5, ceiling 25). Pass save_to to write the file to a sandboxed local directory instead and get back only {path, filename, mimeType, size, sha256} — use this for anything large (video, audio, big PDFs) or anything local tools need as a file. File attachments only — Microsoft item/reference attachments return NOT_SUPPORTED.
| Parameter | Type | Description |
|---|---|---|
attachment_id * | string | |
message_id * | string | |
filename | string | On-disk filename to use with save_to (sanitized). Defaults to the attachment's sanitized name. |
mailbox | string | |
max_size_mb | integer | Size cap in MB. Inline default 5, inline ceiling 25; with save_to the default and ceiling are 150. |
save_to | string | Directory to write the file into instead of returning base64. Sandboxed like body_file and attachment paths: relative paths resolve against the working directory only; directories in an AGENT_EMAIL_AL… |
download_message
Save a whole message, as received, to a sandboxed local directory as a raw RFC 822 .eml file (Graph /$value, Gmail format=raw). Returns {path, filename, mimeType, size, sha256}, never the bytes. Use it to keep a record copy next to attachments saved with download_attachment save_to.
| Parameter | Type | Description |
|---|---|---|
message_id * | string | |
save_to * | string | Directory to write the file into instead of returning base64. Sandboxed like body_file and attachment paths: relative paths resolve against the working directory only; directories in an AGENT_EMAIL_AL… |
filename | string | On-disk filename (sanitized; the extension is always .eml). Defaults to the message subject. |
mailbox | string | |
max_size_mb | integer | Size cap in MB. Default and ceiling 150. |
label_email
Apply labels or categories to one or more emails
| Parameter | Type | Description |
|---|---|---|
labels * | array | |
id | string | |
ids | array | |
mailbox | string |
flag_email
Flag or unflag an email as important/starred
| Parameter | Type | Description |
|---|---|---|
id * | string | |
flagged | boolean | |
mailbox | string |
mark_read
Mark an email as read or unread
| Parameter | Type | Description |
|---|---|---|
id * | string | |
is_read | boolean | |
mailbox | string |
delete_email
Delete an email (disabled by default, requires explicit configuration). On Gmail only drafts can be deleted under the default scopes, and a draft delete is permanent (Gmail has no trash for drafts); deleting sent or received Gmail mail returns NOT_SUPPORTED.
| Parameter | Type | Description |
|---|---|---|
id * | string | Message id to delete. On Gmail this must be a draft: either its draft id or the id of its message. A Gmail draft gets a new message id on every update; its draft id stays stable. |
user_explicitly_requested_deletion * | boolean | |
hard_delete | boolean | |
mailbox | string |
move_to_folder
Move an email to a specific folder (inbox, archive, trash, etc.). Returns the new message ID since Graph assigns a new ID after moving.
| Parameter | Type | Description |
|---|---|---|
folder * | string | |
id * | string | |
mailbox | string |
list_folders
Recursively list mail folders, including computed paths for nested folders
| Parameter | Type | Description |
|---|---|---|
mailbox | string |
create_folder
Create a custom child mail folder (defaults to a child of Inbox)
| Parameter | Type | Description |
|---|---|---|
display_name * | string | |
mailbox | string | |
parent_folder | string |
delete_folder
Delete a custom mail folder, including any mail it contains (disabled by default, requires explicit configuration). Well-known/system folders are protected.
| Parameter | Type | Description |
|---|---|---|
folder * | string | |
user_explicitly_requested_deletion * | boolean | |
mailbox | string |
list_inbox_rules
List server-side inbox rules with all fields reported by the provider
| Parameter | Type | Description |
|---|---|---|
mailbox | string |
create_inbox_rule
Create a persistent server-side inbox rule using safe actions only; forwarding, redirection, and deletion are blocked. Confirm with the user before calling — this creates a rule that keeps acting on the mailbox 24/7 after the session ends.
| Parameter | Type | Description |
|---|---|---|
actions * | object | |
conditions * | object | |
display_name * | string | |
exceptions | object | |
is_enabled | boolean | |
mailbox | string | |
sequence | integer | |
user_explicitly_approved | boolean |
delete_inbox_rule
Delete a server-side inbox rule by id (disabled by default, requires explicit configuration). Removing a rule can silently re-expose the mailbox to mail the rule was filtering.
| Parameter | Type | Description |
|---|---|---|
id * | string | |
user_explicitly_requested_deletion * | boolean | |
mailbox | string |