Skip to main content
Glama
flt-sudo

gmail-mcp-server

by flt-sudo

List Gmail labels

gmail_list_labels
Read-onlyIdempotent

List all Gmail labels (system and user) with IDs to map label names to IDs for use in label modification operations.

Instructions

List every label in an account — system labels (INBOX, UNREAD, STARRED, SPAM, TRASH, ...) and user labels — with their ids. gmail_modify_labels operates on label IDS, so call this first to translate names to ids.

Args:

  • account (string, optional): email or alias. Omit for the default account.

  • response_format: 'markdown' (default) or 'json'.

Returns: label name, id, and type (system/user) for every label.

Examples:

  • {}

  • {"account": "work", "response_format": "json"}

Error Handling: expired credentials return a re-auth instruction naming the account.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountNoEmail or alias of the account to use. Omit to use the default account. Call gmail_list_accounts if unsure.
response_formatNoOutput format: 'markdown' for compact human-readable rendering (default), 'json' for the full normalized structure.markdown

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, openWorldHint, idempotentHint, and destructiveHint=false. The description adds concrete return shape (name, id, type for every label) and credential-expiry behavior, going beyond the annotations. It does not contradict the annotations, and the only minor omission is explicit pagination/rate-limit behavior, which is not necessary for this simple read.

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?

The description is well-organized with a purpose line, Args, Returns, Examples, and Error Handling, making it easy to scan. It is slightly redundant with the schema's parameter documentation, but every section earns its place and the most important guidance is front-loaded.

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 read-only listing tool with no required parameters and no output schema, the description covers purpose, parameter usage, return fields, example calls, and failure behavior. It also explains how the output relates to gmail_modify_labels, so nothing an agent needs to call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already documents both parameters at 100% coverage, including defaults, enums, and account guidance. The description essentially restates the same account/response_format semantics without adding novel detail, so the baseline 3 applies.

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 states a specific verb ('List every label') and a clear resource (a Gmail account), and it enumerates both system labels and user labels with IDs. It also differentiates itself from gmail_modify_labels by noting that the sibling operates on label IDs. This is specific, distinct, and not a tautology.

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 explicitly instructs the agent to call this tool first to translate label names to IDs before using gmail_modify_labels. It also clarifies account omission for the default account and includes error handling for expired credentials. This is direct when-to-use guidance with a named sibling alternative.

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