Skip to main content
Glama
gmail-mcp
by gchallen

batch_modify_messages

Destructive

Bulk-apply or remove Gmail labels across selected message IDs or a Gmail search query to archive newsletter backlogs or mark search results as read.

Instructions

Bulk label change: over a list of message IDs, or over every message matching a Gmail query (up to maxMessages, default 500). Built for triage such as archiving a newsletter's backlog (query "from:news@x.com", removeLabelIds ["INBOX"]) or marking a search read. Returns the count and IDs touched.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "batch_modify_messages"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryNoGmail search syntax, exactly as in the Gmail search box. Operators: from:, to:, cc:, bcc:, subject:, label:NAME, in:(inbox|sent|drafts|trash|spam|anywhere|archive), is:(unread|read|starred|important), has:attachment, filename:pdf, after:YYYY/MM/DD, before:YYYY/MM/DD, newer_than:7d, older_than:1y, larger:10M, "exact phrase", OR, -negation, ( ) grouping, {a b} for OR. Whitespace is AND. Keep queries keyword-based rather than pasting whole subjects.
messageIdsNo
addLabelIdsNo
maxMessagesNo
removeLabelIdsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2026.9.2

TDQS

A3.9/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true and openWorldHint=true, so the safety profile is known. The description adds useful operational context (default maxMessages of 500, return shape with count and IDs), but never says whether the operation is reversible, how query and messageIds interact if both are supplied, or that query-scoped runs can mutate an unbounded set. For a destructive bulk mutation that is a meaningful gap.

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 scope definition is front-loaded, then examples, then return value — a good ordering with no filler. The example clause is somewhat long and could be tightened, but every element adds information.

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

Completeness4/5

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

With 5 parameters, low schema coverage, and no output schema, the description does well by documenting return values and the default cap. It remains incomplete on the query/messageIds relationship and mutation safety, which matters for a destructive bulk tool.

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

Parameters3/5

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

Schema description coverage is only 20%, so the description has to carry weight: it explains query syntax by reference to the Gmail search box, supplies example operators, and states the maxMessages default. However, addLabelIds/removeLabelIds are only illustrated obliquely through the example, the interaction between query and messageIds is unaddressed, and whether labels are IDs vs names is not clarified.

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 ("Bulk label change") and immediately defines both scoping modes — explicit message IDs or a Gmail query — making it easy to distinguish from single-message siblings like label_message/unlabel_message.

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

Usage Guidelines4/5

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

Two concrete triage scenarios (archiving a newsletter backlog with removeLabelIds ["INBOX"], marking a search read) give a clear sense of when this bulk tool is appropriate. It stops short of explicit exclusions, e.g. pointing to label_message for single-message edits or warning when a query is too broad.

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