Skip to main content
Glama
flt-sudo

gmail-mcp-server

by flt-sudo

Modify Gmail labels

gmail_modify_labels
Idempotent

Add or remove Gmail labels on a message or thread to organize, archive, mark read/unread, or star. Specify target ID and label IDs to update.

Instructions

Add and/or remove labels on one message or one whole thread. This is also how you archive and mark read/unread:

  • Archive: remove_label_ids: ["INBOX"]

  • Mark read: remove_label_ids: ["UNREAD"] · Mark unread: add_label_ids: ["UNREAD"]

  • Star: add_label_ids: ["STARRED"]

Args:

  • message_id OR thread_id (exactly one, required): target. Ids are account-specific.

  • add_label_ids (string[], optional), remove_label_ids (string[], optional): label IDS, not names — call gmail_list_labels to translate. At least one of the two is required.

  • account (string, optional): email or alias. Omit for the default account.

Returns: confirmation with the resulting label set (message) or affected thread id.

Examples:

  • {"message_id": "18c2...", "remove_label_ids": ["UNREAD"]}

  • {"thread_id": "18c2...", "add_label_ids": ["STARRED"], "remove_label_ids": ["INBOX"], "account": "work"}

Error Handling: unknown label ids return a Gmail error — list labels first. A 404 usually means the id belongs to a different account.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, and destructive hints. The description adds valuable behavioral context: account-specific IDs, the requirement of exactly one message_id or thread_id, and that at least one of add/remove is needed. It also describes the return value. No contradictions 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 organized with clear sections (Args, Returns, Error Handling) and includes two concise examples. While it is longer than typical, every sentence adds value—no filler or redundancy. The main purpose is front-loaded, and details are structured for easy scanning.

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 tool with no output schema and limited annotations, the description is remarkably complete. It covers usage, parameter constraints, return values, error scenarios, and even practical tips like account-specific IDs. An agent could invoke this tool correctly without additional information.

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?

The input schema is empty, so the description carries the full burden of parameter documentation. It thoroughly explains each parameter (message_id/thread_id, add_label_ids, remove_label_ids, account) with constraints, defaults, and the distinction between label IDs and names. This exceeds what a schema would typically provide.

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 the tool's purpose: 'Add and/or remove labels on one message or one whole thread.' It also explains that it is the mechanism for archiving and marking read/unread, and provides specific label IDs for those operations. This distinguishes it from sibling tools like gmail_trash_message and gmail_list_labels.

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?

The description provides explicit guidance on when to use the tool (e.g., to archive, mark read/unread, star) and how to translate label names to IDs via gmail_list_labels. It also includes error handling advice (list labels first, 404 suggests wrong account). While it doesn't explicitly contrast with siblings, the examples and notes make usage clear.

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