Skip to main content
Glama

manage_trash

Move emails to trash or delete permanently with optional filters. Preview actions via dry-run and confirm before emptying trash.

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
Behavior4/5

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

Since no annotations are provided, the description fully shoulders behavioral disclosure. It details dry run previews, safety limits, required confirmations, and filters. However, it does not mention reversibility of actions (e.g., whether permanent deletion is irreversible).

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 logically structured with a brief overview followed by a parameter list. While it is somewhat lengthy due to 11 parameters, it avoids redundancy and each sentence adds value. Could be slightly more concise, but the length is warranted.

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 complexity (11 parameters, no annotations, output schema present), the description fully covers usage, safety, and edge cases. It explains actions, filters, and safety flags. The return value is mentioned as a confirmation message, which is sufficient when an output schema exists.

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?

Schema description coverage is 0%, so the description must explain all 11 parameters. It does so thoroughly: each parameter is described with default values, usage notes (e.g., subject_keywords matches any, not used for empty_trash), and safety constraints (e.g., max_deletes default 5). This adds significant meaning beyond the schema.

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 clearly states it manages trash operations (delete emails or empty trash), which is distinct from all sibling tools. No other tool handles trash management, making the purpose unambiguous.

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 dry_run vs actual deletion, safety confirmations like confirm_empty, and filtering parameters. It lacks explicit 'when not to use' but the context is clear given the action-focused behavior.

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