Skip to main content
Glama
LeChabrax

Apple Mail MCP Server

by LeChabrax

delete_mailbox

DestructiveIdempotent

Delete a mailbox via IMAP, optionally removing its messages. Requires confirmation and IMAP credentials; refuses non-empty mailboxes unless forced.

Instructions

Delete a mailbox via IMAP.

Mail.app's AppleScript dictionary doesn't expose a working delete primitive for mailboxes, so this operation goes through IMAP. Requires IMAP credentials in Keychain (#73 opt-in flow) — returns error_type: "imap_required" when missing.

Always elicits user confirmation (destructive). By default refuses non-empty mailboxes to prevent accidental data loss; pass delete_messages=True to cascade.

Refused (#164): targeting the bare [Gmail] parent or any [Gmail]/... child path returns error_type: "unsupported_gmail_system_label". Gmail's IMAP server doesn't support DELETE for these paths.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesMailbox name. Slash-separated for nested mailboxes.
accountYesMail.app account display name or UUID.
delete_messagesNoWhen False (default), refuse if the mailbox contains messages. When True, cascade-delete the mailbox and its contents.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

The description substantially extends the annotations (destructiveHint=true) by detailing that user confirmation is always elicited, default refusal for non-empty mailboxes, cascade option, Gmail system-label restriction, and the error_type when credentials are missing. This provides a rich behavioral model beyond the boolean hints, covering edge cases and safety measures.

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?

The description is structured into logical sections: method, prerequisite, safety behavior, and Gmail exception. It is informative without being excessively verbose, though it could be tightened. The core purpose is front-loaded in the first sentence, which aids quick comprehension.

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?

Given the destructive nature and conditional behaviors, the description covers all critical aspects: the IMAP mechanism, credential requirement, default safety refusal, cascade override, and unsupported Gmail paths. With an output schema present, return details are not needed. An agent has sufficient context to decide when and how to call this tool safely.

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

Parameters3/5

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

Schema coverage is 100%, so baseline is 3. The description adds context for the delete_messages parameter by explaining the cascade behavior and default refusal, but this largely mirrors the schema descriptions. No significant new parameter-specific information is provided beyond what the schema already states.

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?

The description explicitly identifies the action ('Delete a mailbox') and the method ('via IMAP'), distinguishes it from AppleScript-based operations, and specifies the resource. This clearly differentiates it from sibling delete tools like delete_messages and delete_account.

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

Usage Guidelines4/5

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

The description provides strong context on when to use this tool: when a mailbox needs deletion and AppleScript lacks a working primitive, requiring IMAP. It also mentions prerequisites (IMAP credentials) and default behavioral restrictions (refuses non-empty mailboxes). However, it does not explicitly name alternatives or exclusions, such as saying 'use delete_messages for deleting messages.' The resource distinction is implied but not explicitly stated.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/LeChabrax/apple-mail-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server