Skip to main content
Glama
adamzaidi

icloud-mcp

by adamzaidi

bulk_delete_by_subject

Delete multiple emails at once by matching a subject pattern in iCloud Mail. Use this tool to remove unwanted messages and maintain inbox organization through bulk operations.

Instructions

Delete all emails matching a subject pattern

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
subjectYesSubject keyword to match
mailboxNoMailbox (default INBOX)

Implementation Reference

  • The 'bulk_delete_by_subject' function implements the deletion logic by searching for emails with a specific subject and deleting them in chunks.
    export async function bulkDeleteBySubject(subject, mailbox = 'INBOX', creds = null) {
      const client = createRateLimitedClient(creds);
      await client.connect();
      await client.mailboxOpen(mailbox);
      const uids = (await client.search({ subject }, { 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, subject };
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. While 'Delete' implies destruction, it lacks critical details: whether deletion is permanent or moves to trash, if the pattern matching supports wildcards/regex, case sensitivity, or performance implications of 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?

Extremely concise at 7 words with the action verb front-loaded. No filler words, though brevity comes at the cost of safety warnings and behavioral details that would be appropriate for a destructive bulk tool.

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?

Given this is a destructive bulk operation with no annotations and no output schema, the description is dangerously minimal. It omits irreversibility warnings, confirmation requirements, and scope limitations (subfolders, date ranges) that would help an agent use this safely.

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 coverage is 100%, establishing a baseline of 3. The description adds 'pattern' which hints at matching behavior (substring vs exact), but doesn't clarify pattern syntax, case sensitivity, or mailbox scoping beyond what the schema already documents.

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 provides a clear verb (Delete), resource (emails), and scope (matching a subject pattern). It implicitly distinguishes from siblings like bulk_delete_by_sender by specifying 'subject pattern', though it doesn't explicitly compare against alternatives.

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 on when to use this tool versus bulk_delete, bulk_delete_by_sender, or delete_older_than. No warnings about the destructive nature or prerequisites like confirming the mailbox 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