Skip to main content
Glama
TG-Techie

apple-mail-mcp

by TG-Techie

delete_mailbox

Delete a mailbox via IMAP with user confirmation. Refuses non-empty mailboxes unless cascade delete is enabled.

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?

With no annotations provided, the description alone must convey the destructive nature and error behavior. It does so thoroughly: confirmation always required, default refusal of non-empty mailboxes, precise error_type values for missing credentials and Gmail path restrictions. This is exemplary disclosure of side effects and edge-case behavior.

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 longer than typical but every sentence serves a purpose: technical rationale, prerequisite, safety behavior, and special-case rejection. It is logically organized into paragraphs with the core purpose first. Slightly more verbose than necessary but well-structured and free of filler.

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 tool's complexity (destructive, requires credentials, special Gmail behavior) and lack of annotations, the description leaves nothing essential uncovered: usage, errors, safety, and constraints are all present. The presence of an output schema means return-value documentation is not required here. Complete for an agent to call correctly.

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?

The input schema covers 100% of parameters with clear descriptions (name, account, delete_messages). The description adds slight nuance to delete_messages by explaining the cascade effect, but this is already implied in the schema's description. Baseline 3 is appropriate since the schema carries the explanatory load.

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?

States a specific action on a specific resource ('Delete a mailbox via IMAP') and immediately differentiates from the built-in Mail.app primitive by explaining why IMAP is used. The acronym IMAP and the mention of Mail.app's AppleScript limitation make the tool's scope unmistakable and distinct from sibling message-deletion tools.

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?

Provides explicit preconditions: requires IMAP credentials, returns a specific error when missing. It also states the tool always elicits user confirmation, refuses non-empty mailboxes unless cascade is requested, and lists the unsupported Gmail system-label paths. These are clear 'when and when-not' directives that an agent can act on without guessing.

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/TG-Techie/apple-mail-mcp'

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