Skip to main content
Glama
wylieswanson

apple-mail-mcp-server

by wylieswanson

delete_mailbox

DestructiveIdempotent

Deletes an email mailbox via IMAP. Requires user confirmation and can cascade-delete messages. Refuses Gmail system labels.

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?

Annotations already declare destructiveHint=true and readOnlyHint=false, but the description adds significant behavioral details: it requires IMAP credentials from Keychain, always elicits user confirmation, refuses non-empty mailboxes by default with a cascade option, and returns specific error types for missing credentials or unsupported Gmail paths. No contradiction with annotations; it enriches the agent's understanding.

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 moderately long but well-structured with paragraphs for method, behavior, and constraints. Each sentence provides distinct value (e.g., reason for IMAP, credential requirement, cascade behavior, Gmail restriction). No fluff.

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, multiple constraints (empty check, Gmail paths, credential requirement), the description is thorough. It covers the operation method, prerequisite, user confirmation, and error handling. Since output schema exists, return values don't need explanation. The description is complete for safe and correct tool use.

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 coverage is 100% with parameter descriptions, but the tool description adds practical context: name is slash-separated for nested mailboxes, account is display name or UUID, and delete_messages defaults to false and cascade-deletes when true. This adds meaning beyond the schema without redundancy.

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 states 'Delete a mailbox via IMAP', which is a specific verb and resource. It distinguishes itself from siblings like 'delete_messages' by explaining why IMAP is used instead of AppleScript, and it's clearly a different operation from 'create_mailbox'.

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 explains when to use the tool (deleting a mailbox) and provides critical conditions: it refuses non-empty mailboxes by default, requires delete_messages=True to cascade, and unsupported for [Gmail] paths. It also mentions the IMAP credentials prerequisite. While it doesn't explicitly list alternatives, the context and mention of unsupported paths give good guidance.

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/wylieswanson/apple-mail-pz-mcp'

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