Skip to main content
Glama
SymbolStar

gmail-mcp

by SymbolStar

list_labels

List all Gmail labels and folders to view your email organization structure. No input parameters needed.

Instructions

List all Gmail labels and folders.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The actual Gmail API call that fetches labels from the Gmail API. Calls gmail.users.labels.list, then maps the response to GmailLabel objects.
    export async function listLabels(): Promise<GmailLabel[]> {
      const gmail = await getGmailClient();
      const response = await gmail.users.labels.list({ userId: USER_ID });
    
      return (response.data.labels ?? []).map((label) => ({
        id: label.id,
        name: label.name,
        type: label.type,
        messageListVisibility: label.messageListVisibility,
        labelListVisibility: label.labelListVisibility,
      }));
    }
  • The GmailLabel type definition used as the return type of listLabels().
    export type GmailLabel = {
      id?: string | null;
      name?: string | null;
      type?: string | null;
      messageListVisibility?: string | null;
      labelListVisibility?: string | null;
    };
  • src/index.ts:61-63 (registration)
    The MCP tool registration: server.tool('list_labels', ...) with no inputs and a handler that calls the imported listLabels() function.
    server.tool("list_labels", "List all Gmail labels and folders.", {}, async () =>
      jsonResult(await listLabels()),
    );
  • Import of the listLabels function from './gmail.js' in src/index.ts, wiring it to the MCP tool registration.
    const { getEmail, listInboxEmails, listLabels, searchEmails } = await import("./gmail.js");
Behavior3/5

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

No annotations are provided, so the description is the sole source. It states the action but lacks details like pagination, data scope, or authentication requirements. For a simple list, this is adequate but minimal.

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?

A single, front-loaded sentence contains all necessary information without waste.

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 simplicity (0 parameters, no output schema) and clear sibling differentiation, the description is complete enough for an agent to use correctly.

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?

The input schema has no parameters and 100% coverage. With 0 parameters, the baseline is 4, and the description does not add parameter information beyond the schema.

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 'List all Gmail labels and folders' uses a specific verb and resource, clearly distinguishing from sibling tools that deal with emails (get_email, list_emails, search_emails).

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?

While no explicit when-to-use or alternatives are stated, the sibling context makes it clear this is for labels/folders vs. emails, implying appropriate usage.

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/SymbolStar/gmail-mcp'

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