Skip to main content
Glama
gmail-mcp

gmail-mcp

add_labels

Add a label to multiple Gmail messages in a single batch request, using batchModify to process up to 1000 IDs per API call, avoiding separate calls per message.

Instructions

CHOICE HINT: When the user asks to "add a label" to multiple emails,
ALWAYS prefer this tool over making N calls to add_label(). It uses
Gmail's batchModify API in chunks of at most 1000 message IDs.

Add a label to multiple emails in a single MCP request.

Uses messages().batchModify() with up to 1000 IDs per Gmail API call.

Required:
  message_ids (list[str]) — Gmail message IDs.
  label (str) — label name. System labels: STARRED, IMPORTANT, etc.
    Custom labels must exactly match how they appear in Gmail.

Returns on success:
  {"ok": true, "data": {
    "requested": N, "succeeded": N, "failed": 0,
    "results": [{"id": "...", "ok": true}, ...]
  }}

Workflow note: Use this instead of N add_label() calls.
  Label names are case-sensitive.

Input Schema

NameRequiredDescriptionDefault
labelYes
message_idsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does well: it discloses batchModify usage, chunking at 1000 message IDs, return structure, partial-failure reporting, and label-name case sensitivity. It stops short of covering permissions, idempotency, or how invalid labels fail, so it is strong but not complete.

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 front-loaded with the choice hint and core purpose, then structured into required parameters and returns. It is slightly repetitive because the CHOICE HINT and the workflow note both say to use this instead of N add_label() calls.

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?

For a mutation tool with no annotations, no output schema, and 0% schema description coverage, the description is fairly complete: it covers usage, batch limits, parameter meaning, return shape, and partial failures. Remaining gaps are around authorization requirements, idempotency, and precise error behavior.

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

Parameters5/5

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

Schema coverage is 0%, so the description must compensate, and it does: message_ids are described as Gmail message IDs, and label is described as a label name with system-label examples, exact-match requirements for custom labels, and case sensitivity. This adds meaningful semantics not present in the bare 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?

States a specific verb and resource: add a label to multiple emails. It explicitly distinguishes itself from the sibling add_label by positioning itself as the batch operation and saying it uses Gmail's batchModify API.

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 when-to-use guidance: when the user asks to add a label to multiple emails, always prefer this over making N calls to add_label(). The CHOICE HINT and workflow note reinforce the alternative clearly.

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