Skip to main content
Glama

Label a thread

threads_modify
Destructive

Apply and remove labels on one thread, or one message of it - an Outlook mailbox's categories are its labels. The ids come from labels_list. Adding SPAM junks it, and taking SPAM off brings it back to the inbox. In a Gmail mailbox adding TRASH bins it too; an Outlook mailbox takes UNREAD and STARRED beside its categories and SPAM, and no other id; a Gmail mailbox whose provider is imap takes only UNREAD, STARRED, SPAM and its own labels, several a call, as Gmail does, each message keeping its id; any other mailbox whose provider is imap takes only UNREAD, STARRED, SPAM and its folders' labels, one folder a call: adding a folder's label moves the inbox messages into it and removing it moves its messages back to the inbox, each message moved taking a new id, which the answer names.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe threadId a search or a read answered, or with scope message the message's id.
scopeNothread, the default, acts on the whole thread; message acts on that one message alone.
mailboxYesThe mailbox's name or its email address.
addLabelIdsNo
removeLabelIdsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
labelIdsYes
messagesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. First observed

TDQS

A3.7/5.0
Behavior4/5

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

With destructiveHint=true already declared, the description goes well beyond the annotation by disclosing concrete effects: SPAM junks the thread, removing SPAM restores it to the inbox, Gmail TRASH bins it, folder-label moves reissue new message ids, and imap mailboxes have varying id constraints. It omits permission/auth requirements and rate limits, but the side-effect disclosure is strong.

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

Conciseness3/5

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

The opening sentence is well front-loaded, but the final provider-taxonomy sentence is a single dense run-on that crams Gmail, Outlook, imap-generic and folder-move rules together. The information is valuable but its structure makes it hard to parse quickly.

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?

Given a 5-param tool with an output schema and destructive annotations, the description covers the essential behavioral surface, including that moved messages get new ids that the response names. It is largely complete, though the per-provider matrix would benefit from being broken out.

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 only 60%, but the description compensates: it explains that id is a threadId from a search/read (or a message id under message scope) and constrains which label ids are valid per mailbox/provider. The addLabelIds/removeLabelIds semantics (junk/unbin, move-to-folder) are only implied rather than spelled out per parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb+resource with scope: 'Apply and remove labels on one thread, or one message of it.' It also flags the label-id source (labels_list). It does not, however, distinguish itself from close siblings like threads_archive, threads_trash, or threads_untrash, which overlap in effect (adding TRASH/SPAM).

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?

It states where ids come from (labels_list) and lays out provider-specific rules for which label ids are legal, which is useful context. But it never explicitly says when to use this tool versus the sibling threads_archive/threads_trash/threads_untrash, leaving the agent to infer routing from the side-effect notes.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.