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
| Name | Required | Description | Default |
|---|---|---|---|
| q | No | Only return messages matching the specified query (same format as Gmail search box) | |
| format | No | When set, auto-fetches full message details. metadata=headers only (default when set), clean=with body, full=raw MIME tree. | |
| labelIds | No | Only return messages with labels that match all specified label IDs | |
| pageToken | No | Page token to retrieve a specific page of results | |
| maxResults | No | Maximum number of messages to return (1-500) | |
| maxBodyChars | No | Max 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. | |
| includeQuoted | No | In clean mode: include quoted reply history. Default false. | |
| includeBodyHtml | No | In full mode only: whether to include parsed HTML body parts | |
| includeSpamTrash | No | Include messages from SPAM and TRASH |