create-draft
Compose a reviewable email draft in Apple Mail with recipients, body, attachments, and optional threading, without sending it; the user sends it manually.
Instructions
Use when: composing an email the user should review in Mail.app before sending — the safe default for any new message (to/cc/bcc are arrays, optional attachments). With inReplyTo/references the draft is threaded: it is composed by this server and filed over IMAP into the account's Drafts mailbox (Mail.app's AppleScript cannot set those headers), so an IMAP account is required. Returns: a confirmation that the draft was created, with recipients and attachment count; for a threaded draft also its Drafts mailbox, account and Message-ID (transport: imap). Do not use when: the user has already confirmed they want it sent now (use send-email), or is replying to an existing message (use reply-to-message with send=false — it derives recipients, threading and the quote and takes attachments). Safety: low risk — creates a draft only and sends nothing; the user must open Mail.app and send it themselves.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cc | No | CC recipients | |
| to | Yes | ||
| bcc | No | BCC recipients | |
| body | Yes | ||
| account | No | Account to create draft in: a Mail account name or an exact sender address, resolved and verified before the draft is saved (no match or a different sender → error, no draft). With inReplyTo/references this must name a configured IMAP account (label or login); when omitted, the IMAP account matching the SMTP identity, else the only IMAP account, is used. | |
| subject | Yes | ||
| inReplyTo | No | Thread this message as a reply: the parent's Message-ID token, angle brackets included (e.g. '<abc123@mail.example.com>'). Emitted verbatim as In-Reply-To, never RFC 2047-encoded. When `references` is omitted, References defaults to [inReplyTo]. Prefer reply-to-message, which derives recipients, threading and the quote from the original for you. | |
| references | No | Thread chain, oldest first: the parent's own References followed by the parent's Message-ID (each an angle-bracketed token). Emitted verbatim, never RFC 2047-encoded. | |
| attachments | No | Files to attach: absolute paths in the configured attachment read roots (e.g. '/Users/me/Documents/report.pdf') and/or inline {filename, contentBase64} objects up to 25 MiB decoded each. | |
| composition | No | Opt in to Mail's visible native editor: inserts only new prose, preserving its signature, HTML quotation and reply ancestry without the AppleScript content setter. Requires an unlocked desktop and existing Accessibility and Automation permissions. Uses Mail.app even when SMTP is configured; cannot be combined with transport=smtp or caller-built threading headers. New messages require an explicit account. Do not interact with Mail or the clipboard while it runs. Failure never falls back to another composition method or sends an unverified message. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | ||
| from | No | AppleScript draft: the sender Mail.app used | |
| account | No | Threaded draft only: IMAP account it was filed in | |
| mailbox | No | Threaded draft only: Drafts mailbox path | |
| inReplyTo | No | ||
| messageId | No | Threaded draft only: the draft's Message-ID | |
| transport | No | ||
| recipients | No | ||
| references | No | ||
| attachmentCount | No |