Skip to main content
Glama

manage_trash

Delete emails or empty trash in Apple Mail with preview mode and safety filters. Use filters by subject, sender, or age to target specific emails before permanent removal.

Instructions

Manage trash operations - delete emails or empty trash.

When dry_run=True (default) and action is "move_to_trash", previews what would be deleted without acting. Set dry_run=False to actually move to trash.

Args: account: Account name (e.g., "Gmail", "Work") action: Action to perform: "move_to_trash", "delete_permanent", "empty_trash" subject_keyword: Optional keyword to filter emails (not used for empty_trash) subject_keywords: Optional list of subject keywords; matches any keyword sender: Optional sender to filter emails (not used for empty_trash) mailbox: Source mailbox (default: "INBOX", not used for empty_trash or delete_permanent) max_deletes: Maximum number of emails to delete (safety limit, default: 5) confirm_empty: Must be True to execute "empty_trash" action (safety confirmation) apply_to_all: Must be True to allow operations without subject_keyword or sender filter older_than_days: Optional age filter - only affect emails older than N days dry_run: If True (default), preview what would be affected without acting

Returns: Confirmation message with details of deleted emails

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountYes
actionYes
subject_keywordNo
subject_keywordsNo
senderNo
mailboxNoINBOX
max_deletesNo
confirm_emptyNo
apply_to_allNo
older_than_daysNo
dry_runNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations provided, the description carries the full burden and excels by disclosing: (1) dry_run behavior previews without acting, (2) max_deletes is a safety limit, (3) action-specific constraints (empty_trash ignores subject_keyword, delete_permanent ignores mailbox), and (4) destructive scope of each action. It fully explains the safety model and default behaviors.

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 structure is logical: summary → dry_run behavior (front-loaded safety) → Args → Returns. Given 11 parameters with complex interdependencies, the length is appropriate. The Args list is comprehensive but necessary due to poor schema coverage. The Returns section is minimal but acceptable since an output schema exists.

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?

For a complex tool with 11 parameters, 3 distinct actions, and multiple safety guards, the description is comprehensive. It covers all parameters, action-specific behaviors, default values, safety constraints (confirm_empty, max_deletes), and filtering logic. The output schema handles return values, so the brief Returns section is sufficient.

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

Parameters5/5

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

The schema has 0% description coverage (only titles). The Args section in the description fully compensates by explaining all 11 parameters: providing examples (account: 'Gmail'), listing valid enum values for action, explaining constraints (mailbox not used for empty_trash), and clarifying safety semantics (confirm_empty, apply_to_all, max_deletes). It adds essential meaning that the schema lacks.

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 opening sentence 'Manage trash operations - delete emails or empty trash' provides specific verbs (manage, delete, empty) and resources (trash, emails). It clearly distinguishes from siblings like 'move_email' or 'compose_email' by focusing specifically on trash lifecycle operations (move_to_trash, delete_permanent, empty_trash).

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 excellent safety guidance explaining when to use dry_run=True (default) for previews versus dry_run=False for actual execution. It documents safety requirements like confirm_empty and apply_to_all. However, it lacks explicit comparison to sibling alternatives (e.g., when to use 'move_to_trash' vs the general 'move_email' tool).

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

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