Skip to main content
Glama
Albretsen

MCP Emails

Delete Email

email_delete
Destructive

Delete emails from a mailbox by ID, batch, or search query. Messages go to Trash unless permanent is true, which removes them irreversibly.

Instructions

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).
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).
unreadNotrue = unread only; false = read only; omit for both.
flaggedNotrue = only flagged/starred messages. Ignored on Outlook.
subjectNoText to match in the subject; phrases match as-is.
inbox_idNoInbox UUID from inbox_list. Optional when the key has one inbox; pass this or `inbox`, not both.
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_foldersNoFolder names to search.

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. Changed7 schema fields changed
    • removedInput schema / allOf
      Removed value: -[
      -  {
      -    "if": {
      -      "properties": {
      -        "action": {
      -          "const": "delete"
      -        }
      -      },
      -      "required": [
      -        "action"
      -      ]
      -    },
      -    "then": {
      -      "not": {
      -        "anyOf": [
      -          {
      -            "required": [
      -              "message_ids"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "from"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "to"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "cc"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "subject"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "body"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "text"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "unread"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "has_attachment"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "flagged"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "since"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "before"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "query"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "include_folders"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "limit"
      -            ]
      -          }
      -        ]
      -      },
      -      "required": [
      -        "message_id"
      -      ]
      -    }
      -  },
      -  {
      -    "if": {
      -      "properties": {
      -        "action": {
      -          "const": "delete_batch"
      -        }
      -      },
      -      "required": [
      -        "action"
      -      ]
      -    },
      -    "then": {
      -      "not": {
      -        "anyOf": [
      -          {
      -            "required": [
      -              "message_id"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "from"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "to"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "cc"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "subject"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "body"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "text"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "unread"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "has_attachment"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "flagged"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "since"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "before"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "query"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "include_folders"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "limit"
      -            ]
      -          }
      -        ]
      -      },
      -      "required": [
      -        "message_ids"
      -      ]
      -    }
      -  },
      -  {
      -    "if": {
      -      "properties": {
      -        "action": {
      -          "const": "search_and_delete"
      -        }
      -      },
      -      "required": [
      -        "action"
      -      ]
      -    },
      -    "then": {
      -      "not": {
      -        "anyOf": [
      -          {
      -            "required": [
      -              "message_id"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "message_ids"
      -            ]
      -          }
      -        ]
      -      }
      -    }
      -  }
      -]
    • changedInput schema / properties / action / description
      Previous value: -"Operation to run. delete = one message_id; delete_batch = up to 500 message_ids; search_and_delete = every message matching a search."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 / idempotency_key / description
      Previous value: -"Opaque key for one operation, outbound or mailbox mutation. Reuse it only when retrying the identical request within 24 hours: the retry is collapsed, not repeated, which matters most for copy. Reuse with different arguments is rejected; omit it for normal behaviour."New value: +"Reuse only when retrying the identical request within 24 hours; the retry is collapsed, not repeated. Reuse with different arguments is rejected."
    • changedInput schema / properties / inbox / description
      Previous value: -"Inbox email address; an alternative to inbox_id, which wins when both are given."New value: +"Inbox email address, an alternative to inbox_id."
    • changedInput schema / properties / inbox_id / description
      Previous value: -"Inbox UUID. Optional when the key has exactly one inbox. Otherwise pass this or `inbox`; omit both and the error lists every inbox_id."New value: +"Inbox UUID from inbox_list. Optional when the key has one inbox; pass this or `inbox`, not both."
    • changedInput schema / properties / message_ids / description
      Previous value: -"Provider-native message ids to delete."New value: +"Provider-native message ids to delete. Duplicates are removed, first occurrence kept, so succeeded counts distinct messages."
    • 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"
      +}
  2. First observedv1.0.4

TDQS

A4.2/5.0
Behavior5/5

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

Adds substantial behavior beyond annotations: deleted messages go to Trash and are recoverable unless permanent: true is passed (irreversible), search_and_delete is bounded by limit, and has_more must be checked before declaring a mailbox fully swept. This is useful operational detail that annotations alone cannot convey.

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?

Five short sentences, front-loaded with the core purpose and followed by safety, irreversibility, pagination, and authorization notes. No filler or repetition; each sentence adds distinct value.

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 complex 21-parameter tool, the description covers the critical behavioral caveats (trash vs permanent, search bounds, scope) that are not obvious from the schema or annotations. With a rich schema and output schema present, nothing essential is missing for correct invocation.

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 covers all 21 parameters, so the baseline is 3. The description goes beyond schema by clarifying the real-world effect of permanent, the recoverability of normal deletes, and the meaning of has_more relative to limit. It does not need to restate individual parameters.

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?

Description states a specific action ('Delete messages in one inbox') and covers three operations via the action enum. It is clear, but it does not explicitly differentiate from siblings such as email_search_and_move or bulk_cancel; the distinction comes from the tool name/schema rather than the description.

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?

Provides operational context: the destructive flag, trash vs permanent deletion, the search_and_delete limit/has_more caveat, and required scope. However, it does not say when to prefer this tool over sibling tools or when not to use it, leaving alternatives unaddressed.

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