# Lists

<a id="lists"></a>

A page that checks a place, such as where a package was delivered, shouldn't carry your town in its file: a page shared as a download would then have it in. Instead, keep the words or places in a named list in **Settings → Lists**, on this Mac, and the page names the list with an [`in_list`](https://legatobar.com/docs/mapping-conditions.md#conditions) condition. A page can also send a list's entries to a service, such as the symbols on a stock watchlist. See [Sending a list](#sending-a-list).

- A list's name is 1–48 characters: `a–z`, `0–9` and `-`, starting with a letter or digit, such as `delivery-area`.
- Each entry is plain text, such as "Fernhollow, ST", never a pattern.
- A value matches when it contains any entry as whole words, whatever the case, accents or punctuation.
- Lists are kept in Settings on this Mac, never in a page file, so a page you share or download names the list and holds no one's places.
- A list that's only checked with `in_list` never leaves the Mac. A list a page sends goes to that page's service each time the page reads it, and Settings → Lists shows where.
- A missing or empty list reads false unless `if_missing` is true, and the page still says where to add it, unless the condition is `optional`.
- An agent can set a list for you with the MCP tool `set_list`, or `legato lists set` from a shell. See [Lists and History](https://legatobar.com/docs/mcp-tools.md#lists-and-history).

## Sending a list

Some services answer one item at a time, such as a stock quote, or take a list of ids in one request, such as coin prices. A named request can send a list's entries:

```json
"requests": {
  "quotes": { "path": "/api/v1/quote?symbol={entry}", "each_entry": { "list": "stock-watchlist", "max": 30 } },
  "prices": { "path": "/api/v3/simple/price?ids={entries}&vs_currencies=usd", "all_entries": { "list": "coins" } }
}
```

- `each_entry` sends the request once for each entry, with `{entry}` filled in. `all_entries` sends it once, with every entry in place of `{entries}`, separated by commas.
- Entries go in the request's path or query, encoded, and nowhere else. An entry that isn't a plain symbol or id isn't sent.
- While the list is missing or empty, nothing is sent, and the page says to add the list in Settings → Lists.
- When you edit the list, the page reads the service again right away.
- In **Settings → Lists**, the **Used by** column names the service: "Stocks · sent to finnhub.io".

[Requests from a list](https://legatobar.com/docs/source-requests.md#requests-from-a-list) has the details.

