Skip to main content
Glama
hgn

Notmuch

by hgn

Find mail attachments

mail_find_attachments
Read-only

Find 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

TableJSON Schema
NameRequiredDescriptionDefault
typeNo
limitNo
queryYes
scopeNo
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already mark the tool as readOnlyHint=true and openWorldHint=false, which covers the safety profile. The description adds behavioral context beyond annotations: it explains the search scope (across a whole search), the `limit` parameter's truncation behavior ('when it truncates the total is still reported'), and scope defaulting. It does not discuss auth or return format, but for a read-only search tool this is adequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured: a one-sentence purpose, then usage guidance with examples, a note about query-level filtering, and an Args section. Every sentence adds value—no filler or repetition. The front-loaded purpose makes it easy to scan, and the Args section is formatted for quick reference.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 4 parameters, no output schema, and no enums, this description covers the core usage well: what the tool does, when to use it, parameter semantics, and limit behavior. It does not describe the structure of returned attachment rows (e.g., fields like filename, size, message ID), which could be helpful given there is no output schema. Still, the lack of such detail does not prevent correct invocation for the described purposes.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must fully compensate. It does: each parameter (query, scope, type, limit) has a clear explanation with examples and default behavior. For instance, `type` is defined with categories and raw extensions, and `limit` clarifies that omission means all results while truncation still reports the total.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with 'Find attachments across a whole search, not just within one message', which is a specific verb+resource+scope statement. It clearly distinguishes itself from the sibling mail_list_attachments by explaining the different scope ('a whole search' vs 'a single message').

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit when-to-use guidance with concrete examples ('all invoices from 2025', 'which PDFs did I get from the accountant') and an explicit alternative for single-message cases: 'use mail_list_attachments instead'. It even notes the notmuch query-level filtering alternative (attachment:*.pdf, tag:attachment).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hgn/mcp-server-notmuch'

If you have feedback or need assistance with the MCP directory API, please join our Discord server