Search messages
search_messagesSearch Gmail accounts using native Gmail query syntax (e.g., from:alice, newer_than:7d, has:attachment) and return message summaries with IDs.
Instructions
Search a Gmail account with native Gmail query syntax (e.g. 'from:alice newer_than:7d has:attachment', 'in:anywhere subject:invoice'). Returns summaries with gmMsgId/gmThrId. Note: All Mail excludes Trash/Spam unless you add 'in:anywhere'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| label | No | Restrict to a specific label/mailbox path instead of All Mail. | |
| limit | No | Max results (default 25, newest first). | |
| query | Yes | Gmail search query (X-GM-RAW syntax). | |
| account | No | Gmail address to act on. Omit to use the default account. |