Skip to main content
Glama

Mark or label messages

update_messages

Mark messages read or unread, star or unstar them, and add or remove labels across Gmail and IMAP mailboxes in a single call of up to 100 message IDs.

Instructions

Mark messages read or unread, star or unstar them, and add or remove labels (Gmail user labels; IMAP keywords). Flags: UNREAD, STARRED. At most 100 ids per call; each id gets its own result. Labels must already exist on Gmail. IMAP keywords with junk or spam in the name ($Junk, $NotJunk) train spam filters and need the delete permission. Changes can be undone with the opposite call (spam-filter training cannot). To move, archive or trash, use move_messages.

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": {
      "account": "<account>",
      "ids": "<ids>"
    },
    "name": "update_messages"
  }
}

Input Schema

NameRequiredDescriptionDefault
idsYesMessage ids of this mailbox (from search_messages or get_message).
accountYesMailbox alias or email address from list_accounts.
add_flagsNoFlags to set (UNREAD marks unread, STARRED stars).
add_labelsNoLabels (Gmail) or keywords (IMAP) to add, at most 20.
remove_flagsNoFlags to clear (removing UNREAD marks read).
remove_labelsNoLabels (Gmail) or keywords (IMAP) to remove, at most 20.

Output Schema

NameRequiredDescriptionDefault
failedNo
accountNo
resultsNo
succeededNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / add_flags / description
      Added value: +"Flags to set (UNREAD marks unread, STARRED stars)."
    • addedInput schema / properties / add_labels / description
      Added value: +"Labels (Gmail) or keywords (IMAP) to add, at most 20."
    • addedInput schema / properties / remove_flags / description
      Added value: +"Flags to clear (removing UNREAD marks read)."
    • addedInput schema / properties / remove_labels / description
      Added value: +"Labels (Gmail) or keywords (IMAP) to remove, at most 20."
  2. First observedv0.11.0

TDQS

A4.8/5.0
Behavior5/5

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

The annotations declare this is a non-read-only, non-destructive, non-idempotent mutation, and the description adds behavior beyond that: per-id results, the batch size ceiling, the requirement that Gmail labels pre-exist, the delete-permission need for $Junk/$NotJunk, and which changes are reversible. The disclosure that spam-filter training cannot be undone is exactly the kind of irreversibility an agent needs and is not in the annotations.

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 definition is dense and front-loaded: the operation set comes first, then limits, then permissions and undo, then the handoff to move_messages. The only mild redundancy is restating the flag pair and the 100-id ceiling that also appear in the schema, but this costs little and reinforces the key constraint.

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?

With an output schema present, return values do not need explanation, yet the description still notes per-id results. For a six-parameter mutation tool it covers limits, prerequisites, permission requirements, reversibility, and the sibling alternative, leaving no operational gap an agent must infer.

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 schema already explains every parameter, giving a baseline of 3. The description adds real meaning beyond that by distinguishing Gmail user labels from IMAP keywords, clarifying that removing UNREAD marks a message read, and noting the existence requirement for labels; it slightly repeats the flag names from the schema.

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 opening sentence states specific verbs and the exact resource: mark read/unread, star/unstar, and add/remove labels and keywords. It also names the sibling it is not (move_messages) for a distinct operation family, so an agent can separate this tool from move, archive, or trash without opening the 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 routes the agent explicitly to move_messages for move, archive, and trash, and gives the operational constraints that affect whether a call can succeed: at most 100 ids per call, and Gmail labels must already exist. It also adds the cost of IMAP keyword spam training and the undo path via the opposite call, which is real when-to-use context rather than restatement.

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