Skip to main content
Glama

label_message

Idempotent

Adds system or user labels to Gmail messages, including lists of up to 100 messages, to archive, mark read, star, or categorize. Optionally creates missing user labels.

Instructions

Add labels to a message (or to a list of messages). Labels: system IDs (INBOX, UNREAD, STARRED, IMPORTANT, CATEGORY_*) or user label IDs (list_labels), or their exact names. Archive = unlabel INBOX; mark read = unlabel UNREAD; star = label STARRED. Trash: trash_*; spam, sent and drafts: never. Reversible, no confirmation needed; at most 100 items per call.

Args: messageId: message ID, or a list of IDs. labelIds: labels to add (IDs or names). createMissing: create missing user labels (default false; otherwise an error).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "messageId": "<messageId>",
      "labelIds": "<labelIds>"
    },
    "name": "label_message"
  }
}

Input Schema

NameRequiredDescriptionDefault
labelIdsYes
messageIdYes
createMissingNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.12.3
    • changedOutput schema / (root)
      Previous value: -{
      -  "properties": {
      -    "result": {
      -      "title": "Result",
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "result"
      -  ],
      -  "title": "label_messageOutput",
      -  "type": "object"
      -}New value: +null
  2. First observedv0.1.0

TDQS

A5/5.0
Behavior5/5

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

Annotations already declare mutation safety (not read-only, not destructive, idempotent, open-world), and the description adds meaningful context beyond them: operations are reversible, no confirmation is needed, and there is a maximum of 100 items per call. It also explains createMissing default/error behavior.

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?

The description is dense but front-loaded: purpose first, then allowed labels/action mapping, then behavioral constraints, then parameter details. Every sentence earns its place by resolving a likely agent ambiguity.

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 mutating batch-label tool with no output schema, the description covers label formats, common action recipes, prohibited target types, reversibility, batch limits, and parameter behavior. An agent has enough information to call it correctly without consulting other documentation.

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 carry parameter meaning, and it does: messageId accepts one ID or a list, labelIds accepts system IDs, user label IDs, or exact names, and createMissing defaults false and errors if a missing label is not created. It even points to list_labels for user label discovery.

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 starts with a specific verb and resource: add labels to a message or list of messages. It distinguishes message-level labeling from thread-level labeling in the sibling set by saying 'message' rather than 'thread', and the name/schema confirm the scope.

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?

It gives explicit mapping of common actions to label operations: archive as unlabel INBOX, mark read as unlabel UNREAD, star as label STARRED. It also names forbidden message types and points to trash_* for trashing, which clearly routes the agent away from this tool where appropriate.

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