Skip to main content
Glama

MCPEmails

Delete Email

email_delete
Destructive

Delete messages in one inbox. Flagged DESTRUCTIVE so your MCP client can ask for confirmation first. Deleted mail goes to Trash and stays recoverable unless you pass permanent: true, which is irreversible. search_and_delete is bounded by limit: has_more: true means matches were left behind. Needs the delete:email scope.

Input Schema

NameRequiredDescriptionDefault
ccNoCc recipient to match: address, name, or fragment.
toNoTo recipient to match: address, name, or fragment.
bodyNoText to find in the body. On Gmail this matches the whole message.
fromNoSender to match: address, name, or fragment.
textNoText to match anywhere, headers included.
inboxNoInbox email address, an alternative to inbox_id.
limitNoCap on messages deleted. Default 500.
queryNoProvider-native raw query (escape hatch); prefer the structured fields. Ignored on Fastmail.
sinceNoReceived on or after this date or datetime (no timezone = UTC). Also takes "2026-06", "today", "7 days ago", "last month" or "30d".
actionYesOperation to run. delete = one message_id; delete_batch = up to 500 message_ids; search_and_delete = every message matching a search, up to limit; the result's has_more says whether matches were left behind.
beforeNoReceived strictly before this date or datetime (no timezone = UTC). Takes the same relative forms as `since`.
unreadNotrue = unread only; false = read only; omit for both.
flaggedNotrue = only flagged/starred messages.
subjectNoText to match in the subject, as written. Gmail (API or IMAP) and Outlook match WHOLE WORDS, so a partial word finds nothing; other IMAP servers substring-match.
inbox_idNoInbox UUID (inbox_list). Optional with one inbox.
permanentNoHard-delete, bypassing Trash. Default false, which trashes it.
message_idNoProvider-native message id from a list or search.
message_idsNoProvider-native message ids to delete. Duplicates are removed, first occurrence kept, so succeeded counts distinct messages.
has_attachmentNotrue = only messages with an attachment. Ignored on generic IMAP.
idempotency_keyNoRetry key: reuse only for the identical call within 24h; it runs once.
include_foldersNoFolders to search, each a folder or label name or id from folder_list, or an alias (works where the mailbox has that role). IMAP covers INBOX only unless you name archive or sent folders; Gmail and Outlook search every folder except the trash (Deleted Items on Outlook; Gmail also skips Spam), so name it to include it.

Output Schema

NameRequiredDescriptionDefault
notesNoServer notes about how this call was handled — for example an argument that was not applied because the selected action does not accept it. Written by MCPEmails, not taken from any message, and absent when there is nothing to report.
failedNo
has_moreNoTrue when messages matching the query were left untouched because of the limit; the sweep is complete only when it is false.
inbox_idNo
operationNo
succeededNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / properties / has_more / description
      Previous value: -"True when messages matching the query were left UNTOUCHED because of the limit. Check this before reporting the sweep complete: re-run until it is false."New value: +"True when messages matching the query were left untouched because of the limit; the sweep is complete only when it is false."
  2. Changed1 schema field changed
    • changedOutput schema / properties / notes / description
      Previous value: -"Server notes about how this call was handled — for example an argument that was not applied because the selected action does not accept it. Written by MCP Emails, not taken from any message, and absent when there is nothing to report."New value: +"Server notes about how this call was handled — for example an argument that was not applied because the selected action does not accept it. Written by MCPEmails, not taken from any message, and absent when there is nothing to report."
  3. Changed2 schema fields changed
    • changedInput schema / properties / idempotency_key / description
      Previous value: -"Reuse only when retrying the identical request within 24 hours; the retry is collapsed, not repeated. Reuse with different arguments is rejected."New value: +"Retry key: reuse only for the identical call within 24h; it runs once."
    • changedInput schema / properties / inbox_id / description
      Previous value: -"Inbox UUID from inbox_list. Optional when the key has one inbox; pass this or `inbox`, not both — a pair naming different mailboxes is refused."New value: +"Inbox UUID (inbox_list). Optional with one inbox."
  4. Changed1 schema field changed
    • changedInput schema / properties / include_folders / description
      Previous value: -"Folders to search, each an alias, a folder or label name, or a folder id (names and aliases resolve for you). IMAP covers INBOX only unless you name archive or sent folders; Gmail and Outlook search every folder except the trash (Deleted Items on Outlook; Gmail also skips Spam), so name it to include it."New value: +"Folders to search, each a folder or label name or id from folder_list, or an alias (works where the mailbox has that role). IMAP covers INBOX only unless you name archive or sent folders; Gmail and Outlook search every folder except the trash (Deleted Items on Outlook; Gmail also skips Spam), so name it to include it."
  5. Changed1 schema field changed
    • changedInput schema / properties / include_folders / description
      Previous value: -"Folders to search, each an alias, a folder or label name, or a folder id (names and aliases resolve for you). IMAP covers INBOX only unless you name archive or sent folders; Gmail and Outlook always search everything."New value: +"Folders to search, each an alias, a folder or label name, or a folder id (names and aliases resolve for you). IMAP covers INBOX only unless you name archive or sent folders; Gmail and Outlook search every folder except the trash (Deleted Items on Outlook; Gmail also skips Spam), so name it to include it."
  6. Changed1 schema field changed
    • changedInput schema / properties / flagged / description
      Previous value: -"true = only flagged/starred messages. Ignored on Outlook."New value: +"true = only flagged/starred messages."
  7. Changed4 schema fields changed
    • changedInput schema / properties / before / description
      Previous value: -"Received strictly before this date or datetime (no timezone = UTC)."New value: +"Received strictly before this date or datetime (no timezone = UTC). Takes the same relative forms as `since`."
    • changedInput schema / properties / inbox_id / description
      Previous value: -"Inbox UUID from inbox_list. Optional when the key has one inbox; pass this or `inbox`, not both."New value: +"Inbox UUID from inbox_list. Optional when the key has one inbox; pass this or `inbox`, not both — a pair naming different mailboxes is refused."
    • changedInput schema / properties / since / description
      Previous value: -"Received on or after this date or datetime (no timezone = UTC)."New value: +"Received on or after this date or datetime (no timezone = UTC). Also takes \"2026-06\", \"today\", \"7 days ago\", \"last month\" or \"30d\"."
    • changedInput schema / properties / subject / description
      Previous value: -"Text to match in the subject; phrases match as-is."New value: +"Text to match in the subject, as written. Gmail (API or IMAP) and Outlook match WHOLE WORDS, so a partial word finds nothing; other IMAP servers substring-match."
  8. Changed1 schema field changed
    • changedInput schema / properties / include_folders / description
      Previous value: -"Folder names to search."New value: +"Folders to search, each an alias, a folder or label name, or a folder id (names and aliases resolve for you). IMAP covers INBOX only unless you name archive or sent folders; Gmail and Outlook always search everything."
  9. Changed24 schema fields changed
    • changedInput schema / properties / action / description
      Previous value: -"Which operation to perform. Determines which other arguments are used."New value: +"Operation to run. delete = one message_id; delete_batch = up to 500 message_ids; search_and_delete = every message matching a search, up to limit; the result's has_more says whether matches were left behind."
    • changedInput schema / properties / before / description
      Previous value: -"ISO 8601 date or datetime; return messages received strictly before (<) this instant."New value: +"Received strictly before this date or datetime (no timezone = UTC)."
    • changedInput schema / properties / before / format
      Previous value: -"date-time"New value: +"date-or-date-time"
    • changedInput schema / properties / body / description
      Previous value: -"Free text to find in the message body. (On Gmail this matches the whole message, not body-only.)"New value: +"Text to find in the body. On Gmail this matches the whole message."
    • changedInput schema / properties / cc / description
      Previous value: -"Carbon-copy (Cc) recipient to match: email address, display name, or fragment."New value: +"Cc recipient to match: address, name, or fragment."
    • changedInput schema / properties / flagged / description
      Previous value: -"true = only flagged/starred messages. Not supported on Outlook/Graph (ignored there)."New value: +"true = only flagged/starred messages. Ignored on Outlook."
    • changedInput schema / properties / from / description
      Previous value: -"Sender to match: email address, display name, or fragment (e.g. \"alice@example.com\" or \"Alice\")."New value: +"Sender to match: address, name, or fragment."
    • changedInput schema / properties / has_attachment / description
      Previous value: -"true = only messages with an attachment. Not supported on generic IMAP (ignored there)."New value: +"true = only messages with an attachment. Ignored on generic IMAP."
    • addedInput schema / properties / idempotency_key
      Added value: +{
      +  "description": "Reuse only when retrying the identical request within 24 hours; the retry is collapsed, not repeated. Reuse with different arguments is rejected.",
      +  "maxLength": 200,
      +  "minLength": 1,
      +  "type": "string"
      +}
    • changedInput schema / properties / inbox / description
      Previous value: -"Email address of the inbox to use, as a friendly alternative to inbox_id. Optional; ignored if inbox_id is given."New value: +"Inbox email address, an alternative to inbox_id."
    • changedInput schema / properties / inbox_id / description
      Previous value: -"UUID of the inbox to use. Optional when the API key has access to exactly one inbox (it is auto-selected). Alternatively pass `inbox` with an email address. If you don't know the inbox_id and several are accessible, just omit it — the response then lists every inbox with its inbox_id so you can retry (calling inbox_list does the same)."New value: +"Inbox UUID from inbox_list. Optional when the key has one inbox; pass this or `inbox`, not both."
    • changedInput schema / properties / include_folders / description
      Previous value: -"Optional list of folder/mailbox names to restrict the search scope."New value: +"Folder names to search."
    • changedInput schema / properties / limit / description
      Previous value: -"Maximum number of matching messages to delete. Default: 500."New value: +"Cap on messages deleted. Default 500."
    • changedInput schema / properties / message_id / description
      Previous value: -"Provider-native message ID as returned by email_list, email_read, or email_search."New value: +"Provider-native message id from a list or search."
    • changedInput schema / properties / message_ids / description
      Previous value: -"Provider-native message IDs to delete. Maximum 500 IDs per call."New value: +"Provider-native message ids to delete. Duplicates are removed, first occurrence kept, so succeeded counts distinct messages."
    • changedInput schema / properties / permanent / description
      Previous value: -"When true, hard-deletes the message (bypasses Trash). When false or omitted, moves the message to Trash. Default: false."New value: +"Hard-delete, bypassing Trash. Default false, which trashes it."
    • changedInput schema / properties / query / description
      Previous value: -"Raw provider-native query string (escape hatch). Prefer the structured fields above. Combined with them where supported; ignored on Fastmail."New value: +"Provider-native raw query (escape hatch); prefer the structured fields. Ignored on Fastmail."
    • changedInput schema / properties / since / description
      Previous value: -"ISO 8601 date or datetime; return messages received on/after (>=) this instant. E.g. \"2026-06-01\"."New value: +"Received on or after this date or datetime (no timezone = UTC)."
    • changedInput schema / properties / since / format
      Previous value: -"date-time"New value: +"date-or-date-time"
    • changedInput schema / properties / subject / description
      Previous value: -"Text to match in the subject line. Multi-word phrases are matched as-is."New value: +"Text to match in the subject; phrases match as-is."
    • changedInput schema / properties / text / description
      Previous value: -"Free text to match anywhere in the message (headers and body)."New value: +"Text to match anywhere, headers included."
    • changedInput schema / properties / to / description
      Previous value: -"Primary (To) recipient to match: email address, display name, or fragment."New value: +"To recipient to match: address, name, or fragment."
    • changedInput schema / properties / unread / description
      Previous value: -"true = only unread messages; false = only read messages; omit for either."New value: +"true = unread only; false = read only; omit for both."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "failed": {
      +      "type": "integer"
      +    },
      +    "has_more": {
      +      "description": "True when messages matching the query were left UNTOUCHED because of the limit. Check this before reporting the sweep complete: re-run until it is false.",
      +      "type": "boolean"
      +    },
      +    "inbox_id": {
      +      "type": "string"
      +    },
      +    "notes": {
      +      "description": "Server notes about how this call was handled — for example an argument that was not applied because the selected action does not accept it. Written by MCP Emails, not taken from any message, and absent when there is nothing to report.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "operation": {
      +      "type": "string"
      +    },
      +    "succeeded": {
      +      "type": "integer"
      +    }
      +  },
      +  "type": "object"
      +}
  10. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the annotations (destructiveHint, idempotentHint), the description discloses that deletions go to Trash and remain recoverable, that permanent: true is irreversible, and that the delete:email scope is required. It also explains the partial-success signal (has_more) for bulk deletes — real behavioral context an agent cannot get from structured fields alone.

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?

Four short sentences, no filler, and the most dangerous fact (Trash by default, irreversible with permanent) is front-loaded right after the scope statement. Every clause carries operational weight.

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?

With annotations covering the safety profile and an output schema covering returns, the description supplies the remaining essentials: recoverability, the auth scope, and bounded-search semantics. It could go further by noting which parameters apply to which action (message_id vs message_ids vs filters), though the schema's action description partly covers that.

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 the 21 parameters are already fully documented; the description only deepens understanding of limit/permanent/has_more, which the schema largely covers too. Baseline 3 is appropriate since the schema does the heavy lifting and the description adds little parameter-level detail of its own.

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 gives a specific verb and resource ('Delete messages') plus a scope constraint ('in one inbox') that separates it from sibling tools like email_search_and_move or email_organize. The three-action model (delete, delete_batch, search_and_delete) is named, so an agent knows exactly which flavor of deletion it is invoking.

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?

It clearly states the condition that selects the irreversible path (permanent: true) versus the recoverable default, and explains that search_and_delete is capped by limit, with has_more: true signalling leftover matches. What's missing is explicit routing against siblings (e.g., when to delete versus move/organize), so the agent must infer that from tool names.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.