Skip to main content
Glama

bulk_modify

Idempotent

Apply label changes to all messages matching a Gmail query in batches of 1000, with partial-failure reporting. Ideal for mass archive, labeling, or mark-read.

Instructions

Bulk-apply label changes to every message matching a Gmail query, batched at 1000 messages per API request. Returns matched/modified counts, affected thread IDs (capped at 500 — modifiedThreadCount has the true total), and per-chunk failures (partial success is reported, not hidden). If more messages match than maxMessages, only the first maxMessages are processed and 'capped' is true — raise maxMessages or re-run to finish the rest. Note: the query hits Gmail's search index as-is, WITHOUT the live re-verification search performs — for read-state-precise bulk ops, verify with search first. USE WHEN: mass operations — 'archive all newsletters older than 30 days' (query + remove INBOX), bulk labeling, bulk mark-read. DO NOT USE: for a single thread (use modify_labels or the dedicated tools), or with neither add nor remove. SIDE EFFECTS: modifies up to maxMessages messages in one call; label changes are reversible by the inverse call.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addNo
queryYes
removeNo
maxMessagesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
cappedYes
failedYes
matchedMessagesYes
modifiedThreadsYes
modifiedMessagesYes
modifiedThreadCountYes
Behavior5/5

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

Annotations declare idempotentHint=true, destructiveHint=false, readOnlyHint=false. The description adds substantial context beyond annotations: capping behavior at maxMessages with 'capped' flag, per-chunk partial-failure reporting, thread ID cap at 500 vs true total in modifiedThreadCount, and the critical caveat that the query hits the search index without live re-verification. Non-idempotent-looking retry semantics ('re-run to finish the rest') are transparently disclosed. No contradiction with 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 description is dense with useful information, front-loaded with the core behavior, and well-segmented with USE WHEN/DO NOT USE/SIDE EFFECTS markers. It's slightly long but every sentence earns its place given the bulk-mutation complexity; no filler or tautology.

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?

This is a moderately complex mutation tool with an output schema present (so return values don't need explanation) and rich annotations. The description covers batching behavior, caps, partial-failure reporting, search-index caveat, use cases, and side effects — comprehensive for the tool's complexity.

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 description coverage is 0%, so the description must carry meaning. It explains the role of maxMessages (cap on processed count, default 1000), and clarifies the query parameter's semantics (hits search index, no live verification). However, it doesn't explicitly explain add/remove parameter formats or the requirement that at least one be provided, though the DO NOT USE line implies it indirectly.

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 clearly states it bulk-applies label changes to messages matching a Gmail query, batched at 1000 per request. It distinguishes itself from siblings by naming modify_labels as the single-thread alternative and explaining the query-based scope.

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?

Provides explicit USE WHEN examples ('archive all newsletters older than 30 days'), explicit DO NOT USE exclusions (single thread — use modify_labels; neither add nor remove), and meaningful prerequisites like the search-index vs live-verification caveat.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/csitte/mailwarden'

If you have feedback or need assistance with the MCP directory API, please join our Discord server