count
Count email messages matching a notmuch query across all IMAP accounts or one account, so you can check result totals before retrieving them.
Instructions
Count the messages matching a query.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"query": "<query>"
},
"name": "count"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | notmuch query, for example from:alice@example.com and date:2026-01-01..2026-06-30. Terms: from: to: subject: tag: folder: attachment: date:, combined with and/or/not. A bare word matches anywhere in the message. | |
| account | No | Limit the search to one account, named as folders and status report it. Omit to search every account at once. | |
| include_excluded | No | Set true to also search the junk and trash folders, which are left out by default. Use it only when a message is expected to be there, since mail in those folders is more likely to be hostile. |