Count mail
mail_countCount messages or threads matching a Notmuch query to verify if a correspondent or subject exists before a full mail search, without fetching results.
Instructions
Count messages or threads matching a query, without fetching any of them.
Cheap way to check whether a correspondent, subject or thread exists at all before running a full mail_search, e.g. "how many mails did I get from X" (count="messages", the right default) versus "how many separate conversations" (count="threads"). Not a substitute for mail_search when you need to see the matches themselves.
Args:
query: A notmuch query, e.g. 'from:alice'. See notmuch-search-terms(7)
for the full syntax, including relative date ranges such as
'date:this_year..', 'date:last_month..', 'date:1Y..' and
'date:2026-01-01..2026-06-30'.
scope: Name of a configured scope to AND with query (see
mail_list_scopes). Defaults to the configured default scope.
count: 'messages' or 'threads'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | messages | |
| query | Yes | ||
| scope | No |