list-mailboxes
Discover mailbox and folder paths in an Apple Mail account, including unread and total message counts, to locate the right mailbox before moving messages or searching a specific folder.
Instructions
Use when: discovering the mailbox/folder paths (and unread/message counts) available in an account, e.g. before moving messages or searching a specific mailbox.
Returns: each mailbox's canonical account-relative path in name, unread/message counts, and a total count. Use the full path for nested mailboxes (for example Archive/Inbox); a top-level Inbox remains Inbox. A source that could not be read is NAMED — the result carries partial: true + failedAccounts and the list is a floor, not the complete set — and a listing Mail refused outright (e.g. an account that does not exist) returns an ERROR naming the accounts that do exist, never an empty list.
Do not use when: you want the messages inside a mailbox (use list-messages or search-messages) or the list of accounts (use list-accounts).
Note: Mail's local "On My Mac" mailboxes are not part of any account, so they are reported under the synthetic account label "On My Mac" — an unscoped call includes them, and account: "On My Mac" lists only them. They will not appear in list-accounts, which reports real accounts only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account | No | Account to list mailboxes from |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | ||
| partial | No | ||
| mailboxes | No | ||
| failedAccounts | No |