Skip to main content
Glama
adamzaidi

icloud-mcp

by adamzaidi

bulk_delete_by_sender

Delete all emails from a specific sender in your iCloud Mail inbox. Use this tool to remove unwanted messages and maintain inbox organization through bulk operations.

Instructions

Delete all emails from a specific sender

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
senderYesSender email address
mailboxNoMailbox (default INBOX)

Implementation Reference

  • The bulk_delete_by_sender function retrieves all emails from a specific sender, chunks them, and deletes them from the mailbox.
    export async function bulkDeleteBySender(sender, mailbox = 'INBOX', creds = null) {
      const client = createRateLimitedClient(creds);
      await client.connect();
      await client.mailboxOpen(mailbox);
      const uids = (await client.search({ from: sender }, { uid: true })) ?? [];
      if (uids.length === 0) { await client.logout(); return { deleted: 0 }; }
      let deleted = 0;
      for (let i = 0; i < uids.length; i += CHUNK_SIZE) {
        const chunk = uids.slice(i, i + CHUNK_SIZE);
        await client.messageDelete(chunk, { uid: true });
        deleted += chunk.length;
      }
      await client.logout();
      return { deleted, sender };
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'Delete' implies a destructive operation, the description fails to specify whether emails are moved to trash or permanently deleted, whether the operation is reversible, or if there are rate limits for bulk operations.

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?

The description is a single efficient sentence with no waste. However, it may be overly terse given the lack of annotations and the destructive nature of the operation; additional context about behavioral traits would improve utility without harming clarity.

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

Completeness2/5

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

For a destructive bulk operation with no output schema and numerous sibling alternatives, the description is incomplete. It lacks safety warnings, recovery information (trash vs permanent), and guidance on the mailbox parameter's role in scoping the operation.

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?

With 100% schema description coverage, the schema already documents both 'sender' and 'mailbox' parameters. The description mentions 'specific sender' which aligns with the required parameter, but adds no additional semantic context (e.g., format expectations, case sensitivity) beyond what the schema provides. Baseline 3 is appropriate for high schema coverage.

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 clearly states the verb (Delete), resource (emails), and filter scope (all from a specific sender). The phrase 'all emails' distinguishes this from the single 'delete_email' sibling, and 'from a specific sender' distinguishes it from 'bulk_delete_by_subject' and general 'bulk_delete'.

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

Usage Guidelines2/5

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

No guidance provided on when to use this tool versus alternatives like 'bulk_delete' (which may use different filters) or 'delete_email' (single item). Given the large number of bulk operation siblings, explicit selection criteria would help prevent incorrect tool selection.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/adamzaidi/icloud-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server