Skip to main content
Glama

List Email Folders

list_email_folders
Read-only

Lists 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

NameRequiredDescriptionDefault
accountNoMail.app account whose folder tree to list (from list_email_accounts). Defaults to every account.
include_countsNoInclude the message count of each folder. Slower, because each folder has to be counted.false

Output Schema

NameRequiredDescriptionDefault
accountsNo
truncatedNo
folder_countNo
next_actionsNo
account_countNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedOutput schema / properties / accounts / items / properties / folders / items
      Added value: +{
      +  "type": "object"
      +}
    • addedOutput schema / properties / next_actions / items
      Added value: +{
      +  "type": "object"
      +}
  2. Changed2 schema fields changed
    • addedInput schema / properties / account / description
      Added value: +"Mail.app account whose folder tree to list (from list_email_accounts). Defaults to every account."
    • addedInput schema / properties / include_counts / description
      Added value: +"Include the message count of each folder. Slower, because each folder has to be counted."
  3. Changed2 schema fields changed
    • removedInput schema / properties / account / description
      Removed value: -"Mail.app account whose folder tree to list (from list_email_accounts). Defaults to every account."
    • removedInput schema / properties / include_counts / description
      Removed value: -"Include the message count of each folder. Slower, because each folder has to be counted."
  4. Changed2 schema fields changed
    • addedInput schema / properties / account / description
      Added value: +"Mail.app account whose folder tree to list (from list_email_accounts). Defaults to every account."
    • addedInput schema / properties / include_counts / description
      Added value: +"Include the message count of each folder. Slower, because each folder has to be counted."
  5. First observed

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already establish the safe read profile (readOnlyHint=true, destructiveHint=false, openWorldHint=false), so the description's extra operational context is high-value: enumerating every account 'can be slow on macOS 15+', counts are off by default because they are slow on IMAP, and the provenance of counts (Mail's local index vs Mail.app's live count) is disclosed along with the unread_count_note response field. No contradictions with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose, differentiation, and the sibling alternative are front-loaded in the first paragraph; performance caveats and parameter guidance follow in separate paragraphs. It is on the long side, and the parenthetical explaining count provenance is dense, but nearly every sentence carries decision-relevant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return-value documentation is not required, yet the description still ties a response field (unread_count_note) to the include_counts behavior. Combined with scope, sibling routing, and performance notes, an agent has everything needed to decide and call correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3; the description still adds meaning beyond the schema by explaining that account comes from list_email_accounts and, more usefully, what include_counts=true actually yields (unread/total per folder) and where those numbers come from. It does not add format/syntax detail beyond that, so it sits above the baseline rather than at the top.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb+resource+scope: 'Lists the full folder (mailbox) tree for Apple Mail (Mail.app) accounts, including nested subfolders.' It immediately differentiates itself from siblings by naming the concrete reason to call it (to discover folder names that move_email and list_emails expect) and by ruling out the m365_list_emails path.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

States when to use it (to discover exact folder names for move_email/list_emails), which accounts it covers, and gives an explicit when-not routing rule: 'For a Graph-only Microsoft 365 mailbox not added to Mail.app, use m365_list_emails instead.' It also tells the caller how to scope the call with account=<name> from list_email_accounts.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources