Skip to main content
Glama

listMessages

List Gmail messages by search query or labels, with pagination and optional clean, full, or metadata formats for headers and bodies.

Instructions

List messages with optional filtering. Clean mode removes quoted reply history by default. Full mode limits decoded text bodies with maxBodyChars. Omit format to get bare IDs only.

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

Input Schema

NameRequiredDescriptionDefault
qNoOnly return messages matching the specified query (same format as Gmail search box)
formatNoWhen set, auto-fetches full message details. metadata=headers only (default when set), clean=with body, full=raw MIME tree.
labelIdsNoOnly return messages with labels that match all specified label IDs
pageTokenNoPage token to retrieve a specific page of results
maxResultsNoMaximum number of messages to return (1-500)
maxBodyCharsNoMax decoded chars per text body — per message in clean mode, per MIME text part in full mode; not a whole-response cap. Oversized undecoded parts (e.g. HTML) are omitted with a totalChars note. 0 = unlimited.
includeQuotedNoIn clean mode: include quoted reply history. Default false.
includeBodyHtmlNoIn full mode only: whether to include parsed HTML body parts
includeSpamTrashNoInclude messages from SPAM and TRASH

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.0.0-rc.1

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It usefully discloses that clean mode removes quoted reply history by default and that omitting format returns bare IDs only, but it does not mention read-only safety, pagination, authentication, or response shape when format is set.

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 front-loaded and only three sentences long. It is efficient, though the maxBodyChars sentence is somewhat redundant with the schema and could be tightened.

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?

For a nine-parameter list tool with full schema documentation and no output schema, the description covers the key mode behaviors and default output. It is slightly incomplete on pagination and explicit read-only status, but those gaps are minor given the schema.

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 schema already documents all nine parameters thoroughly. The description adds meaningful semantics beyond the schema by stating that omitting format returns bare IDs only, and it reinforces the relationship between full mode and maxBodyChars.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a clear verb and resource: 'List messages with optional filtering.' It does not explicitly distinguish listMessages from siblings such as listThreads or listDrafts, so it falls short of the top score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides mode-level guidance by explaining clean mode, full mode, and omitting format for IDs. However, it does not say when to use this tool instead of related siblings like listThreads or listDrafts, nor does it state exclusions.

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