Skip to main content
Glama

create_label

Idempotent

Creates a Gmail label and returns its ID, reusing the existing ID when the name already exists. Supports nested label paths and optional palette colors for new or existing labels.

Instructions

Create a user label and return its id. Idempotent: if the name already exists (case-insensitive), its existing id is returned and nothing is created. Nested labels: separate levels with '/' (e.g. 'Clients/Acme') — each missing parent level is created too. Colour: pass backgroundColor AND textColor together as '#rrggbb' (Gmail rejects one without the other, and accepts only colours from its own palette). Giving a colour for a label that already exists RECOLOURS it — that is how an existing label, such as the snooze label, gets a colour. Gmail colours only labels you created yourself; system labels like INBOX or CATEGORY_UPDATES refuse one. USE WHEN: you want a label's id up front, to pre-create a label without applying it to anything, or to make an existing label visible at a glance in Gmail. DO NOT USE: just to file mail under a new label — modify_labels/bulk_modify already auto-create an unknown name passed in add. SIDE EFFECTS: creates the label if missing, and sets its colour when one is given; no mail is changed.

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": {
      "name": "<name>"
    },
    "name": "create_label"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYes
textColorNo
backgroundColorNo

Output Schema

NameRequiredDescriptionDefault
idYes
nameYes
colorNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.25.0
    • removedInput schema / additionalProperties
      Removed value: -false
  2. Changed3 schema fields changedv0.18.0
    • addedInput schema / properties / backgroundColor
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / textColor
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / color
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "backgroundColor": {
      +      "type": "string"
      +    },
      +    "textColor": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "backgroundColor",
      +    "textColor"
      +  ],
      +  "type": "object"
      +}
  3. Addedv0.6.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare idempotentHint=true and destructiveHint=false, but the description goes well beyond them: case-insensitive idempotency semantics, automatic creation of missing nested parent levels, the requirement that both colours be supplied together with Gmail palette restrictions, and the non-obvious fact that supplying a colour to an existing label RECOLOURS it. It closes with an explicit SIDE EFFECTS statement clarifying no mail is touched.

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 purpose and idempotency, then colour rules, then labelled USE WHEN / DO NOT USE / SIDE EFFECTS blocks that make it scannable. It runs long and a couple of clauses (the snooze-label example, the restated recolour explanation) could be tightened, but essentially every sentence carries non-redundant information.

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?

An output schema exists so return values need no explanation, annotations cover the safety profile, and the description still supplies the operational rules an agent would otherwise get wrong (nested creation, colour pairing, system-label refusal, recolour side effect). Nothing needed to call this correctly is missing.

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 carries the full burden — and it does: `name` gains '/' hierarchy syntax and case-insensitive matching behaviour, while `textColor`/`backgroundColor` gain the '#rrggbb' format, the both-or-neither rule, and the palette constraint. Nothing about the three parameters is left ambiguous.

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?

Opens with a specific verb+resource ('Create a user label') plus the return value ('return its id'), and explicitly contrasts itself with modify_labels/bulk_modify. An agent can distinguish it from every sibling without opening a schema.

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?

Contains explicit USE WHEN conditions (need the id up front, pre-create without applying, make an existing label visible) and a DO NOT USE clause naming the alternative (modify_labels/bulk_modify auto-create unknown names in `add`). This is exactly the when/when-not/alternative structure the top score requires.

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