Export Emails
export_emailsExport Apple Mail emails to TXT or HTML files for backup or analysis. Choose a single message by keyword or an entire mailbox, then save results to a directory.
Instructions
Export emails to files for backup or analysis.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"account": "<account>",
"scope": "<scope>"
},
"name": "export_emails"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scope | Yes | Export scope: "single_email" (requires subject_keyword) or "entire_mailbox" | |
| format | No | Export format: "txt", "html" (default: "txt") | txt |
| account | Yes | Account name (e.g., "Gmail", "Work") | |
| mailbox | No | Mailbox to export from (default: "INBOX") | INBOX |
| max_emails | No | Maximum number of emails to export for entire_mailbox (default: 1000, safety cap) | |
| save_directory | No | Directory to save exports (default: "~/Desktop"). Protected locations (dot-folders in ~, LaunchAgents, ~/Library/Application Support, ...) are rejected. | ~/Desktop |
| subject_keyword | No | Keyword to find email (required for single_email) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |