List Email Folders
list_email_foldersLists the full folder (mailbox) tree for Apple Mail (Mail.app) accounts, including nested subfolders. Use this to discover the exact folder names that move_email(target_mailbox=...) and list_emails(mailbox=...) expect. Outlook.com, Exchange, Gmail, iCloud and IMAP accounts added to Mail.app are all included. For a Graph-only Microsoft 365 mailbox not added to Mail.app, use m365_list_emails instead.
Pass account= (from list_email_accounts) to enumerate one account fully; without it, every account is walked which can be slow on macOS 15+. Message counts are off by default (slow on IMAP) — pass include_counts=true to add unread/total per folder (from Mail's local index when a named account resolves from disk, or Mail.app's own live count otherwise — see unread_count_note in the response either way).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account | No | Mail.app account whose folder tree to list (from list_email_accounts). Defaults to every account. | |
| include_counts | No | Include the message count of each folder. Slower, because each folder has to be counted. | false |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| accounts | No | ||
| truncated | No | ||
| folder_count | No | ||
| next_actions | No | ||
| account_count | No |