Skip to main content
Glama

mail_mark_messages

Idempotent

Mark specific iCloud Mail messages as read, unread, flagged, or unflagged by UID while leaving them in their folder and changing nothing else.

Instructions

Set or clear the read and flagged state of specific messages, by uid, without moving them or changing anything else.

Use when: the owner asks to mark particular messages read, unread, flagged or unflagged. Not for everything matching a filter (use mail_run_bulk_action with action mark_read, which previews and can be undone), for filing (use mail_move_messages), or for deleting (use mail_delete_messages). Parameters:

  • uids and uidvalidity must come from the same mail_search_messages (or mail_get_messages) result for folder.

  • read and flagged are independent: omit one to leave it as it is; omitting both changes nothing.

  • read=false marks unread, flagged=false removes the flag. Behavior:

  • Only the Seen and Flagged flags change; the messages stay in their folder and the change syncs to the owner's devices.

  • Repeating the call gives the same state.

  • A renumbered folder (uidvalidity changed) is refused before anything changes.

  • A long list goes in chunks. Returns: {folder, uids, read, flagged}, echoing what was applied; it does not confirm that each uid still exists. Errors: 'Could not open the folder' (check mail_list_folders) or out-of-date uids (search again).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
readNotrue = mark read, false = mark unread, omit = leave unchanged.
uidsYesMessage uids in that folder (from mail_search_messages).
folderYesMail folder, e.g. INBOX, Sent, Archive or a custom name.
flaggedNotrue = flag, false = unflag, omit = leave unchanged.
uidvalidityYesThe 'uidvalidity' from the result the uids came from (required: a renumbered folder is refused, not misread).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -{
      -  "additionalProperties": true,
      -  "title": "mail_mark_messagesDictOutput",
      -  "type": "object"
      -}New value: +null
  2. Addedv0.12.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations cover the safety profile (idempotent, non-destructive, closed-world, mutating), and the description adds substantial context beyond them: only Seen and Flagged change, messages stay in-folder, changes sync to devices, repeats are idempotent, a renumbered folder (uidvalidity changed) is refused before any change, and long lists are chunked. It also names error strings and recovery steps.

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?

Structured into Purpose, Use-when, Parameters, Behavior, Returns and Errors blocks with the routing constraint front-loaded ahead of the alternative tools. It is long but every line carries operational information an agent needs; no filler sentences.

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 5-parameter mutation tool with no output schema, the description supplies the echoed return shape, the idempotency guarantee, the refusal behavior for stale uidvalidity, and the two named error conditions with remediation. Nothing an agent needs 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 100%, so the baseline is 3, but the description adds real cross-parameter meaning: uids and uidvalidity must originate from the same mail_search_messages/mail_get_messages result, read and flagged are independent, and omitting both is a no-op. The omit-vs-false semantics are restated from the schema rather than newly added, which keeps this just below a 5.

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?

Opens with a specific verb-plus-resource ('Set or clear the read and flagged state of specific messages, by uid') and immediately scopes it ('without moving them or changing anything else'). An agent can distinguish this from mail_move_messages, mail_delete_messages, and bulk operations 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?

Explicit 'Use when' clause names the exact owner intent (mark particular messages read/unread/flagged/unflagged) and then names three alternatives with their distinct roles: mail_run_bulk_action for filter matches, mail_move_messages for filing, mail_delete_messages for deletion. The bulk alternative even notes it previews and is undoable, which is a genuine routing signal.

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