count_messages
Count messages matching search criteria without downloading them, enabling you to preview search result sizes and build folder statistics efficiently.
Instructions
Count messages matching search criteria without fetching full message data. Use to check how many messages a search would return before running it, or to build folder statistics. Supports all search_emails filters.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| folder | No | Folder to count in. Defaults to INBOX. | |
| query | No | Free-text filter. | |
| from | No | Sender filter. | |
| to | No | Filter by recipient address. | |
| subject | No | Subject filter. | |
| hasAttachment | No | Filter by attachment presence. | |
| label | No | Filter by folder label applied locally. | |
| threadId | No | Filter by thread id, applied locally. | |
| senderDomain | No | Filter by sender domain, applied locally. | |
| isRead | No | Read status filter. | |
| isStarred | No | Starred status filter. | |
| dateFrom | No | Inclusive start date in ISO format. | |
| dateTo | No | Inclusive end date in ISO format. | |
| sizeLarger | No | Only count messages larger than this size in bytes. | |
| sizeSmaller | No | Only count messages smaller than this size in bytes. |