Skip to main content
Glama

create_label

Idempotent

Creates a Gmail label, returning its ID. Supports nested labels by auto-creating missing parents. Idempotent: existing names return the existing ID. Use to pre-create labels before applying to mail.

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. USE WHEN: you want a label's id up front, or to pre-create a label without applying it to anything. 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; no mail is changed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
nameYes
Behavior5/5

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

Beyond the annotations (idempotentHint=true, readOnlyHint=false), the description discloses critical behavioral details: case-insensitive name matching, auto-creation of missing parent levels for nested labels, and that no mail is changed. These side effects are clearly stated, going well beyond what annotations alone convey.

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 compact but dense, with each sentence or clause serving a distinct purpose: main action, idempotency, nested behavior, usage guidelines, and side effect clarification. The use of bolded sections (USE WHEN, DO NOT USE, SIDE EFFECTS) improves scannability without fluff.

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?

Given the tool's complexity (idempotent label creation, nested hierarchy, alternative tools), the description covers all necessary context: what it does, when to use it, when not to, behavioral nuances, and side effects. The output schema exists, so return values are not explicitly needed. Nothing essential 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?

The schema has only a single `name` string parameter with a minLength. The description adds essential semantics: case-insensitivity, slash-separated hierarchy, and that missing parents are also created. This fully compensates for the 0% schema description coverage.

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: 'Create a user label and return its id.' It clearly distinguishes from sibling tools by noting idempotent behavior and nested label handling, and explicitly contrasts with modify_labels/bulk_modify for different use cases.

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?

The description provides explicit USE WHEN ('you want a label's id up front') and DO NOT USE ('just to file mail under a new label') guidance, and names the alternative tools (modify_labels/bulk_modify) with the specific reason they are preferred in that scenario.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/csitte/mailwarden'

If you have feedback or need assistance with the MCP directory API, please join our Discord server