Skip to main content
Glama
adamzaidi

icloud-mcp

by adamzaidi

mark_older_than_read

Mark unread emails older than a specified number of days as read to clean up your inbox through bulk triage.

Instructions

Mark all unread emails older than N days as read. Useful for bulk triage of a cluttered inbox.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysYesMark emails older than this many days as read
mailboxNoMailbox (default INBOX)

Implementation Reference

  • The function `markOlderThanRead` marks emails older than a specified number of days as read. It connects to the IMAP server, searches for unread messages before the calculated date, and adds the `\Seen` flag to them.
    export async function markOlderThanRead(days, mailbox = 'INBOX', creds = null) {
      const client = createRateLimitedClient(creds);
      await client.connect();
      await client.mailboxOpen(mailbox);
      const date = new Date();
      date.setDate(date.getDate() - days);
      const raw = await client.search({ before: date, seen: false }, { uid: true });
      const uids = Array.isArray(raw) ? raw : [];
      if (uids.length === 0) { await client.logout(); return { marked: 0, olderThan: date.toISOString() }; }
      await client.messageFlagsAdd(uids, ['\\Seen'], { uid: true });
      await client.logout();
      return { marked: uids.length, olderThan: date.toISOString() };
    }
Behavior3/5

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

With no annotations provided, the description must carry the full burden of behavioral disclosure; it specifies the operation affects 'all unread emails' (indicating scope), but omits reversibility details, performance implications for large operations, and return value information since no output schema exists.

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 two-sentence structure efficiently conveys the core functionality and specific use case without redundancy. Every phrase earns its place—the first defines the operation mechanics while the second provides the value proposition.

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?

Given the lack of output schema and annotations, the description is incomplete regarding what the tool returns (count of affected emails, success boolean, etc.). For a bulk mutation operation affecting potentially thousands of emails, the absence of behavioral details like idempotency or error conditions creates a significant information gap.

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?

The input schema has 100% description coverage with both 'days' and 'mailbox' parameters fully self-documented. The description references 'N days' which aligns with the days parameter semantics, but adds no additional clarifying context (such as valid ranges or format) beyond what the schema already provides.

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?

The description explicitly states the action (Mark...as read), target resource (unread emails), and filtering criteria (older than N days). It effectively distinguishes from siblings like `mark_as_read` (single email) and `archive_older_than` (different action) by specifying both the temporal scope and the state-change intent.

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?

It provides implied usage context stating it is 'Useful for bulk triage of a cluttered inbox,' suggesting when to employ the tool. However, it fails to explicitly differentiate from similar age-based siblings like `archive_older_than` or `delete_older_than`, or clarify when marking read is preferable to archiving or deleting.

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