Skip to main content
Glama

create_label

Idempotent

Create a Gmail label and return its id, including nested paths like 'Clients/Acme' and optional colours. Use it to get a label's id upfront or recolour an existing label.

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. Changed2 schema fields changedv0.32.0
    • 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. Changed1 schema field changedv0.25.0
    • removedInput schema / additionalProperties
      Removed value: -false
  3. 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"
      +}
  4. Addedv0.6.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations only say readOnly=false, idempotent=true, destructive=false; the description goes well beyond by defining idempotency precisely (case-insensitive name match returns the existing id and creates nothing), nested-parent auto-creation, the paired-colour requirement, the Gmail palette restriction, and the recolour side effect. The SIDE EFFECTS line states what mutates and what does not ("no mail is changed").

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-loads the core action and id return, then layers semantics, then usage rules, then side effects — a logical order with no filler sentences. It is dense and long for a three-parameter tool, but nearly every clause conveys a distinct constraint an agent would otherwise trip over.

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?

Covers naming, nesting, colour pairing, palette limits, recolouring existing labels, system-label refusal, and the no-mail-change guarantee. With an output schema present, the description need not explain the return payload, and it correctly does not.

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 description coverage is 0%, so the description must carry the load and does: `name` is case-insensitive and '/' delimits nesting levels; `backgroundColor` and `textColor` must be supplied together as '#rrggbb' from Gmail's palette, and one without the other is rejected. That is meaningfully more than the bare string types in 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?

Opens with a specific verb+resource+return: "Create a user label and return its id." The USE WHEN / DO NOT USE block explicitly separates it from modify_labels and bulk_modify, so an agent can route between them without inspecting schemas.

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?

Gives three concrete when-to-use cases (need the id up front, pre-create without applying, make a label visible) and an explicit exclusion: don't use it merely to file mail, because modify_labels/bulk_modify auto-create unknown names in `add`. That is the exact decision boundary an agent needs.

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