gmail_search
Find Gmail messages matching a query and get IDs/thread IDs, or enrich results with sender, subject, date, and snippet.
Instructions
Search Gmail messages with a Gmail query (same syntax as the Gmail search box, e.g. label:finance after:2026/01/01). Returns only id/threadId per hit by default (ids-only, quota-safe). Set enrich: true to add From/Subject/Date/snippet — this costs one extra messages.get request per hit, bounded by concurrency (default 4). limit defaults to 50 when omitted; pass 0 explicitly to auto-paginate up to a hard cap (10000) — expensive combined with enrich: true, use deliberately. Read-only. Mirrors omni-dev gmail search. Output is YAML.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum results. Defaults to 50 when omitted; `0` explicitly means fetch every match up to the hard cap (10000). | |
| query | Yes | Gmail search query, same syntax as the Gmail search box (e.g. `label:finance after:2026/01/01`). Required. | |
| enrich | No | When `true`, enrich each hit with From/Subject/Date/snippet via one extra `messages.get` request per hit. Defaults to `false` (ids-only, the quota-safe default — `messages.get` costs 5 units against Gmail's 250 units/user/second budget). | |
| account | No | Selects a named Gmail account instead of the ambient `--account`/`OMNI_DEV_GMAIL_ACCOUNT` resolution — e.g. `work`. Omit to use the resolved default account (or the legacy single-account credentials, if no named accounts are configured). Call `gmail_account_list` to discover configured names. | |
| concurrency | No | Bounds concurrent `messages.get` calls when `enrich` is true (has no effect otherwise). Defaults to 4, clamped to 1-50 regardless of what is requested — Gmail's quota is 250 units/user/second and `messages.get` costs 5 units, so a higher value could burst past it. |