Skip to main content
Glama
apple-mail-mcp

apple-mail-mcp

by sweetrb

flag-message

Idempotent

Flag a single Apple Mail message by ID and optionally assign a color label for later search and cross-mailbox organization.

Instructions

Use when: flagging a single message (by id), optionally with a color (red/orange/yellow/green/blue/purple/gray). Returns: a confirmation that the message was flagged (and the color, when applied). Do not use when: flagging several at once (use batch-flag-messages) or removing a flag (use unflag-message). Get the id from search-messages or list-messages first. Note: the color is applied on both routes — AppleScript sets the flag index, IMAP writes the equivalent $MailFlagBit0/1/2 keywords Mail.app reads — and search-messages' flagColor filter finds colored messages again later, so a color works as a cross-mailbox label.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "id": "<id>"
    },
    "name": "flag-message"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYes
colorNoOptional flag color (Apple Mail palette: red, orange, yellow, green, blue, purple, gray — 'grey' accepted). Omit for Mail's default flag. The color is applied on both routes: AppleScript sets the flag index, and IMAP writes the equivalent $MailFlagBit0/1/2 keywords Mail.app reads — so a smart mailbox keyed on flag color matches either way.

Output Schema

NameRequiredDescriptionDefault
idNo
okNo
colorNo
colorAppliedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv2.10.24
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. Changed2 schema fields changedv2.10.8
    • changedInput schema / properties / color / description
      Previous value: -"Optional flag color (Apple Mail palette: red, orange, yellow, green, blue, purple, gray — 'grey' accepted). Omit for Mail's default flag. Colors are applied via Mail.app (AppleScript); for an IMAP-routed message id the flag is set but the color is not applied (IMAP flags are colorless)."New value: +"Optional flag color (Apple Mail palette: red, orange, yellow, green, blue, purple, gray — 'grey' accepted). Omit for Mail's default flag. The color is applied on both routes: AppleScript sets the flag index, and IMAP writes the equivalent $MailFlagBit0/1/2 keywords Mail.app reads — so a smart mailbox keyed on flag color matches either way."
    • changedOutput schema / additionalProperties
      Previous value: -falseNew value: +true
  3. Addedv2.9.0
  4. Removedv2.8.10
  5. Changed3 schema fields changedv2.8.2
    • addedInput schema / properties / color
      Added value: +{
      +  "description": "Optional flag color (Apple Mail palette: red, orange, yellow, green, blue, purple, gray — 'grey' accepted). Omit for Mail's default flag. Colors are applied via Mail.app (AppleScript); for an IMAP-routed message id the flag is set but the color is not applied (IMAP flags are colorless).",
      +  "enum": [
      +    "red",
      +    "orange",
      +    "yellow",
      +    "green",
      +    "blue",
      +    "purple",
      +    "gray",
      +    "grey"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / color
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / colorApplied
      Added value: +{
      +  "type": "boolean"
      +}
  6. First observedv2.6.1

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare the safety profile (non-read-only, idempotent, non-destructive, closed-world), so the description doesn't need to restate it. It adds genuinely non-obvious behavior instead: the color is applied on both the AppleScript and IMAP routes via $MailFlagBit0/1/2 keywords, which means the flag is visible in Mail and in smart mailboxes. It stops short of describing failure modes (invalid id, message not found).

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 Use when / Returns / Do not use when / Note structure is front-loaded and skimmable. The final Note is the weakest part: it repeats the color-keyword mechanics already present in the schema's color description, adding length without new decision-relevant information.

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

Completeness5/5

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

For a two-parameter mutation with an output schema present, the description covers purpose, routing, id sourcing, and the persistence semantics of color. Return values need not be explained since the output schema exists, and nothing needed to call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 50%; the color parameter is well documented in the schema, but id only has a pattern and no prose. The description compensates partly by stating the string id is required and must come from search-messages or list-messages, and by framing color as an optional cross-mailbox label. It adds meaning but doesn't explain the alternate 'imap:...' id form.

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 opens with a specific verb and resource ("flagging a single message (by id)") and immediately contrasts it with the two nearest siblings, batch-flag-messages and unflag-message. An agent can distinguish this tool's job without opening any schema.

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

Usage Guidelines5/5

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

It gives explicit when-to-use, explicit when-not-to-use with named alternatives (batch-flag-messages for several, unflag-message for removal), and a prerequisite step ("Get the id from search-messages or list-messages first"). Nothing about routing is left to inference.

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