Skip to main content
Glama

MCP Emails

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: check has_more before reporting a mailbox fully swept. Needs the delete:email scope.

Input Schema

TableJSON 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 from inbox_list. Optional when the key has one inbox; pass this or `inbox`, not both — a pair naming different mailboxes is refused.
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_keyNoReuse only when retrying the identical request within 24 hours; the retry is collapsed, not repeated. Reuse with different arguments is rejected.
include_foldersNoFolders 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.

Output Schema

TableJSON 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 MCP Emails, 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. Check this before reporting the sweep complete: re-run until it is false.
inbox_idNo
operationNo
succeededNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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."
  2. 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."
  3. 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."
  4. 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."
  5. 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"
      +}
  6. First observed

TDQS

A4.2/5.0
Behavior5/5

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

The annotations already mark destructiveHint=true, but the description goes significantly beyond that by explaining the real-world effect: deleted mail goes to Trash and stays recoverable unless permanent: true makes it irreversible. It also discloses the scope requirement and the pagination-style bound on search_and_delete. This is exactly the behavioral context a client needs beyond the annotation flags.

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, each earning its place: what it does, safety flag, deletion semantics, and search_and_delete caveat. The most important safety-relevant information is front-loaded and there is no filler.

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?

For a destructive tool with 21 parameters, full schema coverage, and an output schema present, the description covers what the structured data cannot: irreversibility, trash behavior, permission scope, and the has_more verification step. Nothing essential is missing for an agent to invoke it safely.

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 description coverage is 100%, so the schema already documents all 21 parameters in detail, setting the baseline at 3. The description adds value by explaining cross-parameter behavior: permanent: true bypasses Trash irreversibly, and search_and_delete is limited by limit with has_more indicating leftover matches. This operational nuance is not fully captured by the individual parameter descriptions.

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?

The description opens with a specific verb and resource: 'Delete messages in one inbox.' This clearly states what the tool does and narrows scope to a single inbox. It does not explicitly contrast with sibling tools like email_search_and_move, so it falls just short of full sibling differentiation.

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 description implies usage by naming the destructive operation and warning about confirmation, and it gives one operational guideline: check has_more after search_and_delete before declaring a mailbox fully swept. However, it never says when to prefer this tool over alternatives such as email_search_and_move or email_organize, nor gives explicit when-not-to-use guidance.

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.