gmail_search
Search Gmail messages with Gmail query syntax. Returns message IDs, thread IDs, and pagination tokens for paging through results.
Instructions
Search Gmail messages using Gmail search syntax.
Uses ADC credentials and sends the mandatory quota-project header.
resultSizeEstimate is only an estimate and stops counting at 201. To
count matches, page through the results with page_token instead.
Args:
query: A Gmail search expression, e.g. "from:alice newer_than:7d".
max_results: Maximum number of message ids to return (1-500).
page_token: The nextPageToken from a previous call, to fetch the next page.
Returns:
A JSON object {messages: [{id, threadId}], nextPageToken, resultSizeEstimate}.
nextPageToken is null on the last page.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| page_token | No | ||
| max_results | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |