# search_mail

> Search or list the messages in one mail folder — returns per message the `uid`, date, size, flags, subject, sender and recipient, newest first, paged.

- Tier: R
- Required scope: contents:email + read:email
- Annotations: readOnlyHint, idempotentHint
- Docs: https://api.inleed.com/tools/search-mail

## Description

Search or list the messages in one mail folder — returns per message the `uid`, date, size, flags, subject, sender and recipient, newest first, paged. With no criteria it lists the latest messages. `text` searches message bodies and headers; `from`/`to`/`subject` match those headers; `since`/`before` bound the date; `unseen=true` only unread. Bodies are never returned — read one message with `read_email` using the returned `uid` + `folder`.

## Input schema

- `address` — string (required). The full mailbox address, e.g. info@example.com.
- `folder` — string. The folder to search, from list_mail_folders (e.g. inbox, Sent, Trash).
- `text` — string. Free text matched against message bodies and headers, e.g. faktura 1042.
- `from` — string. Match the From header, e.g. anna@example.com or just anna.
- `to` — string. Match the To header.
- `subject` — string. Match the Subject header.
- `since` — string. Only messages on/after this date, YYYY-MM-DD.
- `before` — string. Only messages before this date, YYYY-MM-DD.
- `unseen` — boolean. Only unread messages when true.
- `limit` — integer. Messages per page, 1-50 (default 20).
- `offset` — integer. Skip this many newest matches — page 2 is offset=limit.

## Example call

```json
{
  "name": "search_mail",
  "arguments": {
    "address": "info@example.se"
  }
}
```

