Search AgentMail messages
search_agentmail_messagesRead-only
Find messages in an AgentMail inbox and return their metadata (id, thread, sender, recipients, subject, date, preview, labels) — not full bodies. With query, a full-text search of sender, recipients, subject and body, best match first. Without it, the newest messages, optionally filtered by labels and by from/to/subject substrings. Then read one with get_agentmail_message, or file it with update_agentmail_labels. Trashed and spam messages are skipped unless asked for.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | A recipient contains this text | |
| from | No | Sender contains this text | |
| after | No | Only messages after this time (ISO 8601) | |
| limit | No | Max results (default 20, cap 100) | |
| query | No | Full-text search; when given, labels/from/to/subject are ignored | |
| before | No | Only messages before this time (ISO 8601) | |
| labels | No | Only messages carrying all of these labels, e.g. ["unread"] | |
| mailbox | Yes | Address of the connected AgentMail inbox to act on. Call list_authorized_mailboxes to see available options. | |
| subject | No | Subject contains this text | |
| pageToken | No | nextPageToken from the previous call, for the next page | |
| includeSpam | No | ||
| includeTrash | No |