Email addresses extract
email-addresses-extract · version 1.0.0 · Communications · free, no key needed
Extract the unique email addresses (RFC 5322 addr-spec subset) from text, normalized, in first-seen order.
Use when you need to: extract email addresses from text · find all email addresses in a document · list unique emails mentioned in a message.
Decide before calling
Read the versioned contract and the supported scope below. Reuse email-addresses-extract@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.
Explain the choice
"I can use email-addresses-extract@1.0.0 for extract email addresses from text. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."
Supported
- extract email addresses from text
- find all email addresses in a document
- list unique emails mentioned in a message
- pull contact emails out of pasted text
- deduplicate email addresses found in text
- harvest addr-spec mailboxes from an email header
- חילוץ כתובות אימייל מטקסט
Not supported
- parse display names or RFC 5322 mailbox/group syntax
- check whether an address can receive mail (DNS, MX or SMTP lookup)
- extract addresses with comments, domain literals or internationalized (U-label) domains
- apply provider-specific rules such as removing dots or +tags
Behavior
- A candidate is a dot-atom local-part, "@", and a domain of at least two ASCII LDH labels (RFC 5322 3.4.1 with the RFC 5321 4.1.2 Domain rule); non-ASCII local-part characters are limited to Unicode letters, marks and numbers (RFC 6531 3.3 subset).
- Scanning is left to right and non-overlapping: the local-part is the maximal atext/"." run before each "@", the domain is the maximal letter/digit/hyphen/"." run after it, and trailing dots are treated as punctuation.
- A candidate is skipped, never shortened or repaired, when any rule fails: local-part over 64 octets, label over 63, address over 254 (RFC 5321 4.5.3.1), all-numeric top-level label, "@", "\" or URL userinfo before it, "@" or a non-ASCII letter/mark/number right after it.
- Leading local-part symbols are dropped only when they form a symmetric wrapper (' ` * _ ~ or { }) that closes right after the domain; otherwise a symbol-led local-part is skipped. Quoted-string local-parts are never extracted from prose.
- Each address is normalized like email-address-normalize: local-part NFC with case preserved, domain lowercased. Duplicates are merged on the normalized form, so local-parts that differ in case stay distinct (RFC 5321 2.4).
- Message-ID values share the addr-spec syntax and are returned when they match; no header context is used. Unicode classes and NFC come from the runtime Unicode version.
- More than 65536 UTF-8 bytes of text, or more than 256 accepted occurrences, is limit_exceeded; empty text returns no addresses.
Input
text(string, required): Free text to scan (at most 65536 UTF-8 bytes).
Output
addresses(array of string, required): max items 256; each min length 5; each max length 254unique_count(integer, required): min 0; max 256occurrence_count(integer, required): min 0; max 256
Limits
- max text bytes: 65536
- max occurrences: 256
Example
Request input:
{
"text": "To: Mary Smith <mary@x.test>, jdoe@example.org, Who? <one@y.test>"
}
Response:
{
"result": {
"addresses": [
"mary@x.test",
"jdoe@example.org",
"one@y.test"
],
"unique_count": 3,
"occurrence_count": 3
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "email-addresses-extract",
"version": "1.0.0",
"input": {
"text": "To: Mary Smith <mary@x.test>, jdoe@example.org, Who? <one@y.test>"
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/email-addresses-extract/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"text":"To: Mary Smith <mary@x.test>, jdoe@example.org, Who? <one@y.test>"}'
The machine-readable contract is at /v1/tools/email-addresses-extract/versions/1.0.0.
CLI
node cli.mjs run email-addresses-extract 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Email address list parse: Parse an RFC 5322 address-list into ordered mailboxes, groups, and a canonical form.
- Email address list deduplicate: Drop duplicate mailboxes in an RFC 5322 address-list, keeping the first one.
- Email address list format: Format mailboxes and groups as one deterministic RFC 5322 address-list.
- Email address spans: Locate every email address occurrence in text with exact half-open code point, UTF-16 and UTF-8 offsets.
- Email address list validate: Check RFC 5322 address-list syntax, including dots, quotes, comments, and groups.
- Email mailbox format: Render a canonical RFC 5322 mailbox from decoded parts, without a delivery claim.