imap_list_folders
Discover all mail folders for an account, including names, hierarchy, and special-use roles, to identify the correct folder before searching, moving, or creating subfolders.
Instructions
List all folders/mailboxes for an account (names, hierarchy delimiter, attributes, RFC 6154 special-use role). Use this first to discover exact folder names before searching, moving, or creating subfolders — folder naming varies by provider (e.g. "Archive" vs "[Gmail]/All Mail" vs "INBOX.Archive"). The specialUse field ("\Sent", "\Drafts", "\Trash", "\Junk", "\Archive") identifies a folder's role independent of its localized name (e.g. "Gesendet" is the Sent folder when specialUse is "\Sent").
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| accountId | No | Account ID (from imap_list_accounts). Optional if accountName is given or only one account is configured. | |
| accountName | No | Account name instead of accountId. Optional if accountId is given or only one account is configured. |