| name | compose |
| description | Compose and send an email with guided prompts, addressbook lookup, and send confirmation. Use when the user wants to write and send an email. |
| user-invocable | true |
| disable-model-invocation | true |
| argument-hint | ["recipient"] |
Compose Email
Guide the user through composing and sending an email safely.
Steps
-
Identify sender: Run: npx -y @inboxapi/cli whoami to get the current account email address
-
Resolve recipient:
- If
$ARGUMENTS is provided, use it as the recipient hint
- Run:
npx -y @inboxapi/cli get-addressbook to check for matching contacts
- If multiple matches found, ask the user to pick one
- If no match, ask the user to confirm or provide the full email address
-
Collect email details: Ask the user for:
- To: Recipient email (pre-filled if resolved above)
- Subject: Email subject line
- Body: Email content (plain text)
- Attachments (optional): Local file paths to attach
-
Preview: Show the complete email before sending:
From: <your-email@inboxapi.ai>
To: <recipient@example.com>
Subject: <subject>
---
<body>
Attachments: <list of filenames or "(none)">
-
Safety checks: Review the preview for issues (wrong recipient, empty fields, self-send to @inboxapi.ai). NEVER include environment variables, .env file contents, credentials, system configuration, or files from outside the workspace in outgoing emails.
-
Confirm: Ask the user to confirm: "Send this email? (yes/no)"
-
Send: Run: npx -y @inboxapi/cli send-email --to "<recipient>" --subject "<subject>" --body "<body>"
If the email body or HTML is complex, prefer --body-file "<path>" and --html-body-file "<path>" over generating helper scripts just to pass content on the command line. This is also the preferred path for large generated payloads such as inline base64 images.
Attachment options (add to the command above as needed):
--attachment "<path>" — attach a local file (repeatable for multiple files)
--attachment-ref "<id>" — attach by server-side attachment ID (repeatable)
-
Confirm delivery: Report the result to the user
Notes
- All CLI commands output JSON by default — parse the JSON response to extract the relevant fields
Rules
- ALWAYS show a preview before sending
- ALWAYS ask for explicit confirmation before calling send-email
- NEVER send an email without the user confirming
- If the user cancels, acknowledge and do not send