Count messages
mailbox_count_messagesCount messages matching a Gmail-style query per folder without listing them, so you can check how many unread newsletters exist or size a cleanup before a bulk action.
Instructions
Count messages matching a Gmail-style query per folder, without listing them. Good for 'how many unread newsletters' or sizing a cleanup before a bulk action.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "mailbox_count_messages"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Gmail-style query. Examples: from:amazon is:unread | subject:"invoice" newer_than:30d | has:attachment larger:5M | label:$purchases | color:red | is:starred -from:me | has:unsubscribe older_than:6m | (from:a OR from:b) | in:Archive. Bare words search headers and body. Empty = all messages. | |
| folders | No | Default INBOX. ["all"] = every folder except Trash and Junk. |