Skip to main content
Glama

Gmail List Labels

gmail_list_labels
Read-onlyIdempotent

List all Gmail labels, including system and user labels, with IDs and types so you can use the correct label names in other Gmail tools.

Instructions

List every label in the mailbox: system labels (INBOX, SENT, DRAFT, SPAM, TRASH, UNREAD, STARRED, IMPORTANT, CATEGORY_*) and the user's own. The other Gmail tools accept label names directly; use this to see which labels exist, their IDs and types. Returns labels (id, name, type 'system' or 'user', message_list_visibility, label_list_visibility, background_color, text_color) and count.

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": "gmail_list_labels"
  }
}

Input Schema

NameRequiredDescriptionDefault

No arguments

Output Schema

NameRequiredDescriptionDefault
countNoNumber of items in this response.
labelsNoEvery label in the mailbox.
has_moreNoWhether another page is available.
fetched_atNoRFC3339 time when this response was fetched.
next_page_tokenNoOpaque token for the next page, or null.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.2.0

TDQS

A4.1/5.0
Behavior3/5

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

Annotations declare readOnlyHint, idempotentHint, openWorldHint, destructiveHint=false, so safety is covered. The description adds that the tool returns each label's visibility settings and colors, plus a count – helpful context. It doesn't cover pagination, edge cases (e.g., labels hidden from list), or error behavior, so it's added value but not rich.

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?

Two sentences, front-loaded with the action and scope; the second sentence explains the use case and return fields. Slightly dense/slightly redundant listing both the category names and the return fields, but no real waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present, the description needn't detail returns, yet it usefully summarizes the key fields and count. For a zero-parameter read tool with full annotations, this is nearly complete; only pagination/size behavior is unaddressed.

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?

No parameters, so baseline is 4. The description can't add parameter meaning beyond an empty schema, and it does note the tool takes no input implicitly by describing only listing.

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?

Specific verb+resource ('List every label in the mailbox') with scope detail: system labels enumerated and user labels, plus the return fields. Clearly distinguishes from gmail_manage_labels by being a read/list operation.

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?

Explains when to use: 'The other Gmail tools accept label names directly; use this to see which labels exist, their IDs and types.' That gives a clear purpose context and an implicit alternative (using labels directly). It does not explicitly exclude gmail_manage_labels or say when to manage versus list, but the guidance is solid.

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