Search Gmail Messages
search_gmail_messagesSearch Gmail messages by query to retrieve matching message and thread IDs with web links. Use standard operators, pagination, and optional headers for metadata, solving email discovery needs.
Instructions
Searches messages in a user's Gmail account based on a query. Returns both Message IDs and Thread IDs for each found message, along with Gmail web interface links for manual verification. Supports pagination via page_token parameter.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The search query. Supports standard Gmail search operators. | |
| page_size | No | The maximum number of messages to return. Defaults to 10. | |
| page_token | No | Token for retrieving the next page of results. Use the next_page_token from a previous response. | |
| include_headers | No | If True, also fetch each message's metadata and include Subject, From, and Date per result. Costs one metadata get per result, grouped into HTTP batches of up to 10, plus retries for transient failures. Defaults to False (output unchanged from prior versions). | |
| user_google_email | Yes | The user's Google email address. Required. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |