Skip to main content
Glama
apple-mail-mcp

apple-mail-mcp

by sweetrb

batch-delete-messages

Destructive

Deletes multiple Apple Mail messages in one call by ID, moving up to 100 to Trash. Returns deleted and failed counts with failure reasons.

Instructions

Use when: deleting multiple messages in one call (1–100 ids; moves them to Trash). Returns: counts of how many were deleted and how many failed, plus the distinct reasons for any failures. Do not use when: deleting just one (use delete-message) or filing messages away (use batch-move-messages). Safety: destructive and applies to many messages at once — require explicit user confirmation, and search-messages/list-messages first to confirm every id is correct before deleting. Pass sourceMailbox/sourceAccount (the mailbox you listed the ids from) so each numeric id is pinned to that mailbox; an id that matches in several mailboxes is refused, not guessed.

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": {
      "ids": "<ids>"
    },
    "name": "batch-delete-messages"
  }
}

Input Schema

NameRequiredDescriptionDefault
idsYes
sourceAccountNoAccount the numeric ids were listed from. Required when sourceMailbox is supplied; on its own it pins nothing.
sourceMailboxNoMailbox the numeric ids were listed from (e.g. 'INBOX'). Must be paired with sourceAccount to form an unambiguous scope. Ignored for imap: ids.

Output Schema

NameRequiredDescriptionDefault
okNo
errorsNo
failedNo
mailboxNo
successNo
countDeltaNo
errorsTruncatedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv2.16.1
    • changedOutput schema / properties / countDelta / items / properties / status / enum
      Previous value: -[
      -  "match",
      -  "over",
      -  "under",
      -  "unknown"
      -]New value: +[
      +  "match",
      +  "over",
      +  "unknown"
      +]
    • addedOutput schema / properties / countDelta / items / properties / unknownReason
      Added value: +{
      +  "enum": [
      +    "count-unreadable",
      +    "no-expectation",
      +    "count-did-not-move",
      +    "count-partial"
      +  ],
      +  "type": "string"
      +}
  2. Changed7 schema fields changedv2.10.24
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / properties / sourceAccount
      Added value: +{
      +  "description": "Account the numeric ids were listed from. Required when sourceMailbox is supplied; on its own it pins nothing.",
      +  "type": "string"
      +}
    • addedInput schema / properties / sourceMailbox
      Added value: +{
      +  "description": "Mailbox the numeric ids were listed from (e.g. 'INBOX'). Must be paired with sourceAccount to form an unambiguous scope. Ignored for imap: ids.",
      +  "type": "string"
      +}
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedOutput schema / properties / countDelta
      Added value: +{
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "account": {
      +        "type": "string"
      +      },
      +      "after": {
      +        "type": [
      +          "number",
      +          "null"
      +        ]
      +      },
      +      "before": {
      +        "type": [
      +          "number",
      +          "null"
      +        ]
      +      },
      +      "expected": {
      +        "type": [
      +          "number",
      +          "null"
      +        ]
      +      },
      +      "mailbox": {
      +        "type": "string"
      +      },
      +      "note": {
      +        "type": "string"
      +      },
      +      "observed": {
      +        "type": [
      +          "number",
      +          "null"
      +        ]
      +      },
      +      "status": {
      +        "enum": [
      +          "match",
      +          "over",
      +          "under",
      +          "unknown"
      +        ],
      +        "type": "string"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / errors
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / errorsTruncated
      Added value: +{
      +  "type": "boolean"
      +}
  3. Changed1 schema field changedv2.10.8
    • changedOutput schema / additionalProperties
      Previous value: -falseNew value: +true
  4. Addedv2.8.14
  5. Removedv2.8.10
  6. First observedv2.6.1

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true, so the bar is lower, yet the description still adds real context: deletions go to Trash (recoverable, not permanent), failures are reported with distinct reasons, and ambiguous ids spanning multiple mailboxes are refused rather than guessed. It also mandates explicit user confirmation and pre-verification, which is exactly the behavioral guidance a destructive multi-item tool needs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Labeled sections (Use when / Returns / Do not use when / Safety) are front-loaded and each sentence carries actionable content. The 'Returns' line duplicates information the output schema already provides, which is the only wasted element.

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 batch operation with three parameters, the description covers scope, safety, ambiguity resolution, and failure reporting. Return-value detail is rightly deferred to the existing output schema.

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 coverage is ~67% and documents sourceAccount/sourceMailbox pairing, but the description goes further by explaining *why* they matter — each numeric id is pinned to one mailbox, and unscoped ids that match in several mailboxes are rejected. The imap: id form is only conveyed via the schema pattern, so it is not fully compensated for in prose.

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?

States a specific verb+resource (deleting multiple messages) with an explicit batch size range (1–100) and destination (Trash), and names the exact siblings it must not be confused with (delete-message, batch-move-messages). An agent can distinguish it from all 50 siblings without opening a schema.

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

Usage Guidelines5/5

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

Explicit 'Use when' and 'Do not use when' clauses, each routing to a named alternative (delete-message for single deletes, batch-move-messages for filing). The prerequisite workflow — search-messages/list-messages first to verify ids — is spelled out rather than implied.

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