Skip to main content
Glama

imap_search_and_delete

DestructiveIdempotent

Search a mailbox by sender, subject, date, or query and delete matching messages in one confirmed bulk operation, up to 500 at a time.

Instructions

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

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "mailbox": "<mailbox>",
      "confirm": "<confirm>"
    },
    "name": "imap_search_and_delete"
  }
}

Input 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

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

A3.5/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true, idempotentHint=true, and readOnlyHint=false, so the safety profile is carried by structured data. The description adds the 500-message cap and the combined-operation nature, but does not say the deletion is irreversible, what happens to matches beyond the limit, or how the confirm requirement interacts with execution. Adequate but not rich beyond annotations.

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?

A single front-loaded sentence with the operation and its bound; nothing is wasted or buried.

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

Completeness3/5

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

The tool has 12 parameters and an output schema, both of which carry much of the burden, and annotations cover the destructive profile. Still, a bulk destructive operation of this size warrants an explicit irreversibility warning and a note that confirm must be true at call time, neither of which the description provides.

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?

Schema description coverage is 100%, so every parameter including confirm and limit is already documented in the schema. The description only echoes the 500 cap, which the limit parameter and its maximum already specify, adding no filter-combination or format meaning.

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?

States a specific verb pair and resource: search messages and delete matches in one operation, which distinguishes it from a two-step search-then-delete flow. It does not name a sibling such as imap_bulk_delete or imap_search_and_move, so the differentiation is implied rather than explicit.

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

Usage Guidelines3/5

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

The phrase 'in one operation' hints at when to prefer this over separate search and delete calls, but there is no explicit when-to-use, when-not-to-use, or named alternative. For a destructive bulk operation, the absence of any caution or alternative routing is a real gap.

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