Count mail
mail_countCount messages or threads matching a query to quickly check how many emails exist from a sender, subject, or time range before running a full search.
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'.
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": "mail_count"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | messages | |
| query | Yes | ||
| scope | No |