Skip to main content
Glama

Mark or label messages

update_messages

Mark Gmail or IMAP messages read or unread, star or unstar them, and add or remove labels or keywords for up to 100 IDs per call.

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. Gmail labels must already exist (create_label makes one). 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.7/5.0
Behavior4/5

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

Annotations already establish non-read-only, non-destructive, non-idempotent behavior, and the description adds substantial context beyond them: a 100-id batch cap, per-id result granularity, the requirement that Gmail labels pre-exist, the delete-permission need for junk/spam keywords, and the reversibility caveat for spam-filter training. The only gap is that it doesn't explain partial-failure semantics when some ids fail, though 'each id gets its own result' hints at it.

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?

Purpose is front-loaded in the first clause, followed by constraints, permissions, and the sibling routing. Every sentence carries operational information (limits, prerequisites, permissions, reversibility) with no filler.

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 six-parameter mutation tool with an output schema, the definition covers batching limits, prerequisites, permission requirements, reversibility, and the alternative tool for move/archive/trash. An agent has enough to call it correctly and interpret results per id.

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 baseline is 3, but the description adds meaning the schema doesn't: labels map to Gmail user labels or IMAP keywords, Gmail labels must already exist, and IMAP keywords containing junk/spam names train spam filters. It also restates the flag semantics already in the schema, which is mild redundancy rather than added value.

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 concrete verbs and resource: mark read/unread, star/unstar, add/remove labels, and clarifies the Gmail-label vs IMAP-keyword distinction. It also names the sibling (move_messages) that handles the adjacent operations, so an agent can separate this tool from it without inspecting schemas.

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?

Gives explicit when-to-use conditions (flag and label changes) and an explicit when-not with the alternative: 'To move, archive or trash, use move_messages.' It further routes label creation to create_label, so the boundary against both relevant siblings is stated.

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