Skip to main content
Glama

Add or remove labels

label_message
Idempotent

Apply or remove Gmail labels on a message using label names or IDs. Handles system labels, so removing UNREAD marks the message as read.

Instructions

Apply and/or remove labels on a message. Accepts label names or ids — names are resolved case-insensitively. Useful system labels: UNREAD, STARRED, IMPORTANT, SPAM, TRASH. Removing UNREAD marks a message as read.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountYesConfigured account: the email address, or the alias given at setup.
add_labelsNoLabels to apply.
message_idYesMessage to modify.
remove_labelsNoLabels to remove.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already establish that this is a non-read-only, idempotent, non-destructive mutation. The description adds real behavioral detail beyond the annotations: label names are matched case-insensitively, either names or IDs are accepted, and removing UNREAD has the side effect of marking the message read. This meaningfully improves the agent's understanding of side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four short sentences, each carrying distinct information: the action, label identifier flexibility, useful system labels, and the UNREAD-to-read side effect. There is no redundancy or filler, and the key action is front-loaded.

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 with four parameterscraper, the description plus schema covers the required fields, label value formats, and important side-effect semantics. It does not explicitly warn that calling it with neither add_labels nor remove_labels is a no-op, nor describe the response shape, but these are minor gaps given the idempotentHint and the absence of an output schema.

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 coverage is 100%, so the baseline is 3, but the description goes further by explaining that add_labels and remove_labels accept both label names and IDs, that names resolve case-insensitively, and that the UNREAD label has special read-marking semantics. This helps the agent construct correct label values beyond just reading the 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?

The description opens with a specific verb and resource ('Apply and/or remove labels on a message') and clearly distinguishes this from sibling tools like list_labels and trash_email by focusing on label mutation. It also clarifies the label namespace and case-insensitive name resolution, leaving no doubt what operation is performed.

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

Usage Guidelines3/5

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

The description implies when to use it—when a message's labels need changing—and lists useful system labels, which gives practical context. However, it never explicitly contrasts this with list_labels, trash_email, or untrash_email, nor does it state conditions when an alternative should be preferred. The guidance is adequate but not explicit.

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