Skip to main content

Description

Returns up to 200 visible mailboxes/folders for the specified account. Includes hierarchy delimiter information when supported by the server.
Mailbox names are server-dependent and may include special characters or Unicode. Common mailboxes include INBOX, Sent, Drafts, Archive, and Trash.

Input Parameters

body.account_id
string
default:"default"
Account identifier matching an environment variable configuration.Pattern: ^[A-Za-z0-9_-]{1,64}$

Response

summary
string
required
Human-readable summary of the operation outcome.Example: "5 mailbox(es)"
data
object
required
meta
object
required
Execution metadata.

Examples

{
  "method": "tools/call",
  "params": {
    "name": "imap_list_mailboxes",
    "arguments": {
      "account_id": "default"
    }
  }
}

Error Cases

Invalid Account ID

{
  "error": {
    "code": "invalid_input",
    "message": "account_id must match pattern ^[A-Za-z0-9_-]{1,64}$",
    "details": {}
  },
  "meta": {
    "now_utc": "2024-03-15T10:30:45.123Z",
    "duration_ms": 1
  }
}

Account Not Found

{
  "error": {
    "code": "not_found",
    "message": "Account 'unknown' not found in configuration",
    "details": {}
  },
  "meta": {
    "now_utc": "2024-03-15T10:30:45.123Z",
    "duration_ms": 2
  }
}

Mailbox Limits

The response is limited to 200 mailboxes. If your account has more mailboxes, only the first 200 will be returned. This limit is enforced to keep response sizes manageable.

Special Mailbox Names

Mailbox names are case-sensitive and server-dependent. Common variations include:
  • INBOX (always uppercase per RFC 3501)
  • Sent vs Sent Items vs Sent Mail
  • Trash vs Deleted Items vs Deleted Messages
  • Drafts vs Draft
  • Archive vs All Mail
Always use the exact name returned by this tool when referencing mailboxes in other operations.

Build docs developers (and LLMs) love