Skip to main content
Glama
SinoEdwards

Mail Agent MCP

by SinoEdwards

imap_bulk_delete_by_search

Delete emails in bulk by matching sender, subject, or date criteria. At least one filter is required to avoid wiping a whole folder; dry-run lets you preview first.

Instructions

Search for emails matching criteria and delete them all. Useful for cleaning up spam or unwanted emails. At least one concrete criterion (from, to, subject, before, or since) is REQUIRED — a call with no criteria is refused so it can never wipe an entire folder. Supports dryRun to preview matches first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNoDelete emails to this recipient
fromNoDelete emails from this sender
sinceNoDelete emails since this date (YYYY-MM-DD)
beforeNoDelete emails before this date (YYYY-MM-DD)
dryRunNoIf true, only return what would be deleted without actually deleting
folderNoFolder nameINBOX
subjectNoDelete emails with this subject
accountIdNoAccount ID (from imap_list_accounts). Optional if accountName is given or only one account is configured.
chunkSizeNoNumber of emails to delete per batch
accountNameNoAccount name instead of accountId. Optional if accountId is given or only one account is configured.
Install Server

TDQS

A4.4/5.0
Behavior4/5

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

No annotations are provided, so the description carries the burden of behavioral disclosure. It explicitly states the destructive outcome (delete them all), the safety guard (no-criteria calls are refused), and the dryRun preview option. It could add more detail about irreversibility or batch behavior, but the core destructive and guarded nature is transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is three concise sentences with no filler. The action and use case lead, followed by the mandatory-criteria safety rule and the dryRun hint. Every sentence contributes critical information for correct invocation.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the destructive bulk nature and the absence of annotations or an output schema, the description covers the essential concerns: what it deletes, when it refuses to run, and how to preview before deleting. It does not describe return values or chunked-batch behavior, but an agent has enough information to invoke it safely and correctly.

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%, so the schema already documents each parameter. The description adds valuable cross-parameter semantics by grouping from, to, subject, before, and since as required criteria and noting that at least one must be supplied. It also highlights dryRun as a preview mechanism, going beyond the schema's per-field descriptions.

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 the action: search for emails matching criteria and delete them all. It specifies the resource (emails) and the filtering behavior, and it distinguishes itself from sibling tools like imap_bulk_delete by requiring search criteria before any deletion.

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 gives clear context: use this for bulk cleanup of spam or unwanted emails. It also provides a strong exclusion rule—calls with no criteria are refused—so an agent knows not to invoke it without at least one of the listed fields. It does not explicitly name alternative tools for single deletions or domain-based cleanup, but the criteria-based use case is clear.

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

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/SinoEdwards/mail-agent-mcp'

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