Get Folders
get_foldersList all email folders with message counts, identifying system mailboxes by IMAP special-use attributes to correctly locate Trash, Sent, and other folders on localized accounts.
Instructions
List all email folders with message counts. Labels appear as folders with the Labels/ prefix (e.g. Labels/Work). Each folder reports folderType (system | user-folder | label) and, for system mailboxes, the IMAP specialUse attribute (\Inbox \Sent \Drafts \Trash \Junk \Archive \All \Flagged) — use these to identify the real Trash/Sent/Archive on a localised account rather than matching English names, and to avoid moving mail into the \All (All Mail) union view.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account_id | No | Optional account ID to route this call to (multi-account configs). Omit to use the active account. Configured account IDs are listed in the settings UI (Accounts tab). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| folders | Yes |