Find mail attachments
mail_find_attachmentsFind attachments across many messages using a notmuch query, and filter by file type (pdf, image, doc, or extension) to locate files like invoices or PDFs.
Instructions
Find attachments across a whole search, not just within one message.
Use this for questions like "all invoices from 2025" or "which PDFs
did I get from the accountant", where the attachment itself, not the
message, is what you are looking for. For a single message's
attachments, use mail_list_attachments instead. Note that notmuch's
own query syntax already supports 'attachment:*.pdf' and
'tag:attachment' inside query if you want to filter at the notmuch
level too.
Args:
query: A notmuch query selecting the messages to scan for attachments.
scope: Name of a configured scope to AND with query (see
mail_list_scopes). Defaults to the configured default scope.
type: Filter by 'pdf', 'image', 'doc' (office documents), or a raw
filename extension such as 'png' or 'xlsx'. Omit for no filter.
limit: Maximum number of attachment rows to return. Omit for all
results (the default); set it only to cap the number returned,
and when it truncates the total is still reported.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | ||
| limit | No | ||
| query | Yes | ||
| scope | No |