list_messages
Retrieve and filter email messages from your Gmail mailbox using search queries, label filters, and pagination controls to manage your inbox effectively.
Instructions
List messages in the user's mailbox with optional filtering
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| maxResults | No | Maximum number of messages to return. Accepts values between 1-500 | |
| pageToken | No | Page token to retrieve a specific page of results | |
| q | No | Only return messages matching the specified query. Supports the same query format as the Gmail search box | |
| labelIds | No | Only return messages with labels that match all of the specified label IDs | |
| includeSpamTrash | No | Include messages from SPAM and TRASH in the results | |
| includeBodyHtml | No | Whether to include the parsed HTML in the return for each body, excluded by default because they can be excessively large |
Input Schema (JSON Schema)
{
"properties": {
"includeBodyHtml": {
"description": "Whether to include the parsed HTML in the return for each body, excluded by default because they can be excessively large",
"type": "boolean"
},
"includeSpamTrash": {
"description": "Include messages from SPAM and TRASH in the results",
"type": "boolean"
},
"labelIds": {
"description": "Only return messages with labels that match all of the specified label IDs",
"items": {
"type": "string"
},
"type": "array"
},
"maxResults": {
"description": "Maximum number of messages to return. Accepts values between 1-500",
"type": "number"
},
"pageToken": {
"description": "Page token to retrieve a specific page of results",
"type": "string"
},
"q": {
"description": "Only return messages matching the specified query. Supports the same query format as the Gmail search box",
"type": "string"
}
},
"type": "object"
}