openmail8.59 KB
View saved version →
---
name: openmail
description: Email for the agent through the OpenMail MCP connector. Use when the user wants to save, find, review, or send an email draft, contact a person, company, or service by email, wait for or check on a reply, sign up for something and confirm the account, receive a verification code or magic link, handle an inbound support request, or anything else that happens over email, even when they say "reach out", "contact support", "sign up", "did they answer", or "subscribe" rather than "email". Also use when the agent needs an address of its own.
license: MIT
---
# OpenMail
OpenMail gives this agent its own inbox. The MCP connector is already signed in; there is nothing to install or configure. The tools are the hands, this file is the habits.
## First call
Run `auth_me` once per conversation. It tells you which organisation you are in and whether you can see one inbox or all of them. If `list_inboxes` is empty, call `setup_agent_email` with `execute: true`; the new address is live immediately.
If several inboxes are available, pass `inbox_id` on inbox-specific mail operations. Ask the user if the intended inbox is unclear.
## Check for new mail
`list_unread_threads` is the way to find out what came in. It lists the newest unread threads, everything included, and flags each one `autoReplyable: yes` (a person or another agent) or `no` (a verification code, receipt, newsletter, or bounce). Only reply to `yes`; never reply to a mailer-daemon. For the user's latest email whether read or not, pass `include_read: true`.
Before you act on a thread, `read_thread` the whole of it. Replies written from a one-line summary go wrong. When you have handled a thread, replied or decided no reply is needed, call `mark_thread_read`, otherwise it comes back next time.
Attachments show a `message:` id under the filename in `read_thread`. Pass that id, not the thread id, to `get_attachment` (the file) or `get_attachment_text` (extracted text). Use `get_attachment` to look at an image or hand a file on: images come back as image content, other files as an embedded resource. Files over 4 MB are refused — there is no signed download link — and `get_attachment_text` is the fallback for PDF, Office, and OCR text.
## Drafts
When asked to discard a draft, identify it with `get_draft` and call `delete_draft` with its ID and exact `updated_at`. This permanently deletes the draft and its files without sending. Optional `inbox_id` must match the owner. On `draft_changed`, review the current draft and verify it is still the one the user wants discarded; never automatically refresh the version and retry. On `draft_sending`, check the draft and sent mail; deletion cannot cancel an accepted or pending send. A missing draft may already have been deleted or sent, so do not claim this request deleted it. Read-only connections cannot delete. OAuth connections use the same `send` scope as draft creation, editing and sending. If missing, reconnect with **Send mail** enabled and refresh tools. Existing send grants already cover deletion.
When asked to prepare an unsent email, use `create_draft` with the sending `inbox_id`. A connection locked to an inbox supplies that ID automatically. If the intended inbox is unclear, look it up with `list_inboxes` or ask the user. Each draft keeps its original sending inbox. Recipients, subject and body are optional at creation. Return the saved draft ID and content for review. Use `edit_draft` to revise saved drafts.
For replies, pass `thread_id` so the draft inherits the subject and stays in the thread when sent. For a forward or new message composed from a conversation, pass `source_thread_id` alone. Both appear on the source thread in the console. For both creation and editing, supply body content only as `body_html`. The API generates the plain-text fallback automatically; do not pass `body` or `body_text`. OpenMail imports embedded and public HTTP(S) raster images. Attach files with `attachment
Preview of the first 4,000 characters. Read full instructions →