Skip to main content
Glama

get_labels

Read-only

List all Gmail labels for an account with their IDs, display names, and types so you can label or unlabel messages and build valid label: search queries. Optionally include real message counts.

Instructions

List every label in one account with its id, display name, and type (system vs user). Use the id for label_messages / unlabel_messages / label_thread; use the display name in a search query (label:Cloudflare, label:"BROH Internship") — a label id in a label: query matches nothing. Message counts are NOT included by default because Gmail's label list does not report them; pass include_counts=true for real message/thread/unread counts (one extra API call per label).

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

Input Schema

NameRequiredDescriptionDefault
accountYesAccount id ("personal", "tamu").
include_countsNoFetch real messagesTotal / messagesUnread / threadsTotal per label. Costs one API call per label; without it counts are reported as unknown rather than guessed.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.6.2

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so safety is covered. The description adds behavior an agent could not otherwise know: counts are absent by default because Gmail's label list does not report them, and include_counts costs one extra API call per label. That cost/limitation disclosure is exactly the kind of context annotations cannot express.

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?

It is a single dense paragraph, front-loaded with purpose and then ordered by usage, then caveat, then cost. Every sentence carries information, though the id-vs-name guidance and the counts caveat run together and would scan faster as separate sentences or bullets.

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?

With no output schema, the description carries the return contract and does so: it names the three returned fields, explains the system/user type split, and accounts for the absence of counts. An agent can call this tool and interpret the response without further inference.

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?

Schema coverage is 100%, so the baseline is 3, but the description reinforces the include_counts tradeoff ('real message/thread/unread counts' vs 'counts are reported as unknown rather than guessed') in terms of downstream meaning rather than just type. It adds modest value beyond the schema text, which already states most of this, and says nothing extra about the required `account` parameter.

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 definition opens with a specific verb+resource+scope: 'List every label in one account,' and immediately enumerates the returned fields (id, display name, type with system vs user distinction). This separates it cleanly from create_label and delete_label, which mutate rather than enumerate labels.

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?

It gives concrete routing rules for the results: use `id` with label_messages / unlabel_messages / label_thread, and use the display name in `label:` search queries, with the explicit warning that a label id in a `label:` query matches nothing. It does not state when to call this instead of any sibling that also enumerates labels, but no such alternative is named in the description, so the guidance is strong for the tools it does reference.

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