text_extract_emails
Extract email addresses from any text using regex with configurable strictness, deduplication, sorting, and context capture. Use for harvesting addresses from logs or documents.
Instructions
Extract Email Addresses From Text. Extract every email address found in a block of arbitrary text using a regex scanner, with selectable strict/standard/permissive matching, optional deduplication, alphabetical sorting, surrounding-context capture, and a unique domain list. Use this for harvesting addresses from logs, documents, or pasted content; use text_extract_urls instead when you need links rather than emails. Matching is pattern-based only (it does not verify deliverability or check MX records over the network). Runs locally on the text you provide: read-only, non-destructive, contacts no external service, and is rate-limited (60 requests per minute for anonymous callers). Returns the matched emails plus per-domain, TLD, and count statistics.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Source text to scan for email addresses. Must not be blank. | |
| extractionMode | No | Regex strictness. standard is a balanced pattern, strict requires well-formed local and domain parts, permissive matches the widest RFC-style character set. | standard |
| removeDuplicates | No | Collapse repeated addresses (case-insensitive) so each email appears once. | |
| sortResults | No | Sort the returned emails (and domains) alphabetically instead of by position of first appearance. | |
| includeContext | No | Include a snippet of surrounding text around each match in the context field. | |
| contextLength | No | Characters of context to capture on each side of a match when includeContext is true (clamped to the 10-200 range). | |
| extractDomains | No | Also return a deduplicated list of the domains that appear in the matched addresses. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| success | No | Whether extraction succeeded. | |
| emails | No | The matched email addresses, lowercased. | |
| stats | No | Statistics about the source text and the extraction. | |
| options | No | The effective options after defaults were applied. | |
| domains | No | Deduplicated domain list (present only when extractDomains is true and matches exist). |