Skip to main content
Glama
adamzaidi

icloud-mcp

by adamzaidi

run_rule

Execute a saved email management rule in iCloud Mail to organize or process messages. Use dryRun mode to preview changes before applying them.

Instructions

Run a specific saved rule by name. Use dryRun: true to preview what would be affected without making changes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesRule name to run
dryRunNoIf true, preview what would be affected without making changes

Implementation Reference

  • The 'runRule' function retrieves a rule by name, executes its associated action (using 'executeRule'), and updates the rule's metadata (lastRun, runCount) in the storage if dryRun is false.
    export async function runRule(name, dryRun = false) {
      const data = readRules();
      const rule = data.rules.find(r => r.name === name);
      if (!rule) throw new Error(`Rule '${name}' not found.`);
      const result = await executeRule(rule, dryRun);
      if (!dryRun) {
        rule.lastRun = new Date().toISOString();
        rule.runCount = (rule.runCount || 0) + 1;
        writeRules(data);
      }
      return { rule: name, action: rule.action.type, ...result };
    }

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