Skip to main content
Glama

List labels

list_labels
Read-onlyIdempotent

Retrieve system and user labels for a Gmail mailbox or folders for an IMAP mailbox, so you can use exact names in search, move, and label update operations.

Instructions

List the labels of one mailbox: system and user labels for Gmail, folders for IMAP. Use the names in search_messages label filters, as move_messages to, or in update_messages add_labels/remove_labels. Read-only; an unknown account returns not_found.

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

Input Schema

NameRequiredDescriptionDefault
accountYesMailbox alias or email address from list_accounts.

Output Schema

NameRequiredDescriptionDefault
labelsNo
accountNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.11.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already cover readOnlyHint, idempotentHint, and destructiveHint=false, so the description's 'Read-only' line is largely redundant. It does add value beyond the structured fields by disclosing error behavior ('an unknown account returns not_found') and the provider-dependent meaning of a label, which the annotations do not 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?

Three short sentences, front-loaded with what is returned, followed by consumption guidance and then the error/read-only caveat. Nothing is padded and no sentence restates the title.

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?

The tool is simple, the single parameter is fully documented, an output schema exists so return values need not be described, and the description still covers provider differences and the not_found case. Nothing an agent needs in order 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.

Parameters3/5

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

Only one parameter, and the schema already documents it at 100% coverage, including the pointer to list_accounts. The description reinforces that the scope is a single mailbox, but it adds no format or syntax detail beyond the schema, so this sits at the baseline.

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?

States a specific verb and resource (list labels of one mailbox) and immediately disambiguates the resource across providers: 'system and user labels for Gmail, folders for IMAP.' That mapping removes the main ambiguity an agent would have about what 'label' means here, and it is clearly distinct from the list_accounts/list_drafts siblings.

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 tells the agent exactly where the returned names get consumed: search_messages label filters, move_messages `to`, and update_messages add_labels/remove_labels. That is concrete downstream routing rather than vague context, so an agent knows both when to call this and what to do with the result.

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