Skip to main content
Glama

modify_labels

Destructive

Add or remove Gmail labels on a message or thread to archive, mark read/unread, star, or organize mail by label IDs.

Instructions

Add or remove labels on a message or an entire thread.

Common label IDs: INBOX (archive = remove INBOX), UNREAD (mark read = remove UNREAD; mark unread = add UNREAD), STARRED, IMPORTANT, TRASH, SPAM. User labels use their id from list_labels.

Args: add_label_ids: Label IDs to add. remove_label_ids: Label IDs to remove. message_id: Target a single message. Provide message_id or thread_id, not both. thread_id: Target every message in a thread. Provide message_id or thread_id, not both.

Returns: For a message: id, thread_id, label_ids. For a thread: id and messages (id + label_ids each). On failure, {"error": "..."}.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "modify_labels"
  }
}

Input Schema

NameRequiredDescriptionDefault
thread_idNo
message_idNo
add_label_idsNo
remove_label_idsNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true, and the description is consistent with that, adding the return shape (id/thread_id/label_ids, or id + messages) and the {"error": ...} failure form. It does not warn that removals are reversible/non-reversible or whether permission scopes are needed, so added behavioral context is modest beyond the annotations and output schema.

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?

Front-loaded with the action sentence, then domain knowledge, then Args/Returns blocks. The Args block is largely redundant with the input schema and the Returns block with the output schema, which costs some efficiency, but nothing is confusing or padded.

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 4-parameter mutation tool with an existing output schema, the description covers targeting semantics, label-ID conventions, the return payload, and error form. Nothing an agent needs to call it correctly is missing.

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 carries the burden and largely does: it defines all four parameters, explains where user label IDs come from (list_labels), lists the well-known system label IDs that drive behavior (INBOX, UNREAD, STARRED, IMPORTANT, TRASH, SPAM), and states the message_id/thread_id exclusivity. The add/remove entries themselves are thin restatements of the names, keeping it below 5.

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 pair (add/remove) and resource (labels) plus the exact scope options (a message or an entire thread). An agent can tell this is the label-mutation tool without opening the schema.

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?

Gives concrete usage recipes (archive = remove INBOX, mark read = remove UNREAD, mark unread = add UNREAD) and states the mutual-exclusivity rule for message_id vs thread_id. It doesn't say when to prefer other approaches (e.g., batch_update for multiple messages) or note prerequisites, so it falls short of full when/when-not guidance.

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

Deploy Server

Other Tools