Agent Email

v0.6.1
io.github.UseJunior/email-agent-mcp Checked 11 hours ago Published 9 days ago

Local 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.

ParameterTypeDescription
folderstring
limitnumber
mailboxstring
offsetnumber
unreadboolean

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…

ParameterTypeDescription
id *string
formatstring
mailboxstring
strip_quoted_historyboolean
strip_signaturesboolean

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.

ParameterTypeDescription
query *string
limitnumber
mailboxstring | null
offsetnumber

get_mailbox_status

Get mailbox connection status, unread count, and warnings

ParameterTypeDescription
mailboxstring

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.

ParameterTypeDescription
message_id *string
mailboxstring

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.

ParameterTypeDescription
allow_duplicatebooleanBypass 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…
attachmentsarrayFiles to attach, maximum 25 MB per file. Each entry takes a sandboxed `path` or inline `base64`.
bodystring
body_filestringPath 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…
ccarray
draftboolean
force_blackbooleanWrap rendered HTML in a force-black div so Outlook dark mode does not hide the text. Default true. Ignored when format is "text".
formatstringBody format. 'markdown' (default) renders via GFM with line-break preservation; 'html' is passthrough; 'text' sends as plain text.
list_stylestringOrdered-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…
mailboxstring
scheduled_send_atstringFuture ISO 8601 delivery time with an explicit timezone. Accepted values are normalized to UTC.
subjectstring
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.

ParameterTypeDescription
body *string
message_id *string
allow_duplicatebooleanBypass 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…
attachmentsarrayFiles to attach, maximum 25 MB per file. Each entry takes a sandboxed `path` or inline `base64`.
ccarray
draftboolean
force_blackbooleanWrap rendered HTML in a force-black div so Outlook dark mode does not hide the text. Default true.
formatstringBody format. 'markdown' (default) renders via GFM with line-break preservation; 'html' is passthrough; 'text' sends as plain text.
include_quotedbooleanInclude provider-assembled quoted history in preview.bodyHtml for draft replies. This affects only the preview, never the stored or sent body.
list_stylestringOrdered-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…
mailboxstring
reply_allbooleanWhen 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…

ParameterTypeDescription
attachmentsarrayFiles to attach, maximum 25 MB per file. Each entry takes a sandboxed `path` or inline `base64`.
bccarrayBcc 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…
bodystring
body_filestringPath 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…
ccarray
force_blackbooleanWrap rendered HTML in a force-black div so Outlook dark mode does not hide the text. Default true.
formatstringBody format. 'markdown' (default) renders via GFM with line-break preservation; 'html' is passthrough; 'text' sends as plain text.
forward_ofstringMessage to forward, retaining original content and attachments. Requires explicit to recipients. Mutually exclusive with reply_to.
fromstringMailbox primary address or verified send-as alias. Fails closed if the provider cannot verify it.
include_quotedbooleanInclude provider-assembled quoted history in preview.bodyHtml. This affects only the preview, never the stored or sent body.
list_stylestringOrdered-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…
mailboxstring
reply_allbooleanOnly 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_tostring
subjectstring
toRecipient 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.

ParameterTypeDescription
draft_id *string
allow_duplicatebooleanBypass 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…
mailboxstring
scheduled_send_atstringFuture 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.

ParameterTypeDescription
draft_id *stringDraft to update. On Gmail either the draft id (r…) or the id of the draft's message, as list_emails(folder: "drafts") reports it.
attachmentsarrayFiles to attach, maximum 25 MB per file. Omit to preserve the draft's existing attachments; provide an array (possibly empty) to replace them entirely.
bccarrayBcc 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.
bodystring
body_filestringPath 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…
ccarray
force_blackbooleanWrap rendered HTML in a force-black div so Outlook dark mode does not hide the text. Default true.
formatstringBody format. 'markdown' (default) renders via GFM with line-break preservation; 'html' is passthrough; 'text' sends as plain text.
fromstringMailbox primary address or verified send-as alias. Fails closed if the provider cannot verify it.
include_quotedbooleanInclude provider-assembled quoted history in preview.bodyHtml. This affects only the preview, never the stored or sent body.
list_stylestringOrdered-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…
mailboxstring
replace_bodybooleanRequired as true to replace the body of a non-reply draft wholesale. Reply draft bodies cannot be edited; create a new draft instead.
subjectstring
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.

ParameterTypeDescription
message_id *string
mailboxstring

list_scheduled_sends

List pending provider-held scheduled sends for a mailbox

ParameterTypeDescription
mailboxstring

list_attachments

List attachments for a specific email message

ParameterTypeDescription
message_id *string
mailboxstring

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.

ParameterTypeDescription
attachment_id *string
message_id *string
filenamestringOn-disk filename to use with save_to (sanitized). Defaults to the attachment's sanitized name.
mailboxstring
max_size_mbintegerSize cap in MB. Inline default 5, inline ceiling 25; with save_to the default and ceiling are 150.
save_tostringDirectory 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.

ParameterTypeDescription
message_id *string
save_to *stringDirectory 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…
filenamestringOn-disk filename (sanitized; the extension is always .eml). Defaults to the message subject.
mailboxstring
max_size_mbintegerSize cap in MB. Default and ceiling 150.

label_email

Apply labels or categories to one or more emails

ParameterTypeDescription
labels *array
idstring
idsarray
mailboxstring

flag_email

Flag or unflag an email as important/starred

ParameterTypeDescription
id *string
flaggedboolean
mailboxstring

mark_read

Mark an email as read or unread

ParameterTypeDescription
id *string
is_readboolean
mailboxstring

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.

ParameterTypeDescription
id *stringMessage 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_deleteboolean
mailboxstring

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.

ParameterTypeDescription
folder *string
id *string
mailboxstring

list_folders

Recursively list mail folders, including computed paths for nested folders

ParameterTypeDescription
mailboxstring

create_folder

Create a custom child mail folder (defaults to a child of Inbox)

ParameterTypeDescription
display_name *string
mailboxstring
parent_folderstring

delete_folder

Delete a custom mail folder, including any mail it contains (disabled by default, requires explicit configuration). Well-known/system folders are protected.

ParameterTypeDescription
folder *string
user_explicitly_requested_deletion *boolean
mailboxstring

list_inbox_rules

List server-side inbox rules with all fields reported by the provider

ParameterTypeDescription
mailboxstring

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.

ParameterTypeDescription
actions *object
conditions *object
display_name *string
exceptionsobject
is_enabledboolean
mailboxstring
sequenceinteger
user_explicitly_approvedboolean

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.

ParameterTypeDescription
id *string
user_explicitly_requested_deletion *boolean
mailboxstring