Skip to main content
Glama

imap_search_and_delete

Search email messages by sender, subject, date, or text, then delete all matches in one bulk operation. Confirmation required to prevent accidental deletions.

Instructions

Search messages and delete matches in one operation (up to 500)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNoFilter by To header
fromNoFilter by From header
limitNoMaximum messages to delete (1..500, default 500)
queryNoFull-text search query
confirmYesExplicit confirmation required (must be `true`)
mailboxYesSource mailbox to search (e.g., `INBOX`)
subjectNoFilter by Subject header
end_dateNoFilter to messages before this date (YYYY-MM-DD)
last_daysNoFilter to messages from last N days
account_idNoAccount identifier (defaults to `"default"`)default
start_dateNoFilter to messages on or after this date (YYYY-MM-DD)
unread_onlyNoFilter to unread messages only

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesTool-specific data payload
metaYesExecution metadata (timestamp, duration)
summaryYesHuman-readable summary of the operation outcome

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.12

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are present, so the description must carry the behavioral burden. It correctly signals destructive intent ('delete') and the 500-message cap, but does not state that deletion is permanent or how confirm=true gates execution. For a destructive combined operation this is a significant gap.

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?

One short sentence front-loads the purpose and the cap; no filler or redundancy.

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

Completeness2/5

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

The tool is complex (12 params, required confirmation, destructive + search behavior), yet the description is a single phrase. It omits irreversible delete semantics, the confirm gate, how matching works across criteria, and what the response/outcome looks like.

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 already documents each parameter well, so the description does not need to duplicate them. It adds nothing about how filters combine or matching semantics, but with ~90% schema coverage the baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states the operation: search messages and delete matches in one combined action, including the 500-message cap. It distinguishes this from pure search or pure delete tools, though it does not explicitly name a sibling tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'in one operation' hints at the use case (avoiding separate search-then-delete calls), but there is no guidance on when to choose this vs. search_messages, mailbox requirements, or safety steps like requiring confirm=true. No conditions or exclusions are given.

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