Skip to main content
Glama
adamzaidi

icloud-mcp

by adamzaidi

bulk_flag_by_sender

Flag or unflag all emails from a specific sender in iCloud Mail to organize messages and manage email priorities.

Instructions

Flag or unflag all emails from a specific sender

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
senderYesSender email address
flaggedYesTrue to flag, false to unflag
mailboxNoMailbox (default INBOX)

Implementation Reference

  • Implementation of bulk_flag_by_sender tool, which flags or unflags all emails from a given sender in a specific mailbox.
    export async function bulkFlagBySender(sender, flagged, mailbox = 'INBOX', creds = null) {
      const client = createRateLimitedClient(creds);
      await client.connect();
      await client.mailboxOpen(mailbox);
      const raw = await client.search({ from: sender }, { uid: true });
      const uids = Array.isArray(raw) ? raw : [];
      if (uids.length === 0) { await client.logout(); return { [flagged ? 'flagged' : 'unflagged']: 0, sender }; }
      if (flagged) {
        await client.messageFlagsAdd(uids, ['\\Flagged'], { uid: true });
      } else {
        await client.messageFlagsRemove(uids, ['\\Flagged'], { uid: true });
      }
      await client.logout();
      return { [flagged ? 'flagged' : 'unflagged']: uids.length, sender };
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While it specifies the scope ('all emails'), it fails to mention whether the operation is idempotent, what happens to emails already in the target state, potential performance implications of bulk operations, or any permission requirements.

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?

The description is a single, efficient sentence that front-loads the action. There is no redundant or wasted text; every word serves to define the tool's core function.

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

Completeness3/5

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

For a 3-parameter tool without an output schema, the description covers the essential function but remains minimal. Given this is a bulk operation affecting potentially many emails, the lack of guidance on error handling, empty results, or confirmation mechanisms leaves it at minimum viability rather than comprehensive.

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 baseline is 3. The description adds minimal semantic value beyond the schema, though it maps the 'flagged' boolean conceptually to the 'Flag or unflag' action. It does not elaborate on parameter formats, validation rules, or the default mailbox behavior beyond what the schema states.

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 action ('Flag or unflag'), resource ('emails'), and scope ('all emails from a specific sender'). It implicitly distinguishes from sibling tools like 'flag_email' (single) and 'bulk_flag' (general criteria) by specifying 'by sender' in the name and 'specific sender' in the description, though it doesn't explicitly contrast with them.

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?

The description offers no guidance on when to use this tool versus alternatives like 'bulk_flag' (which may filter by different criteria) or 'flag_email' (for single messages). There are no stated prerequisites, exclusions, or conditions that would help an agent select this over similar bulk operations.

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