batch_modify_messages
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
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Gmail 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. | |
| messageIds | No | ||
| addLabelIds | No | ||
| maxMessages | No | ||
| removeLabelIds | No |