Skip to main content

validate_email

Validates that a string is a syntactically well-formed email address in local-part@domain format (RFC 5322). Returns a valid flag and, on failure, a human-readable reason explaining the structural problem.

Parameters​

ParameterTypeRequiredDescription
emailstringYesThe email address string to validate.

Response​

FieldTypeDescription
validbooleantrue if the address is syntactically well-formed, false otherwise.
reasonstring | nullShort explanation of why the address is invalid; null when valid.

Examples​

Valid address​

{
"email": "user@example.com"
}

Result:

{
"valid": true,
"reason": null
}

Invalid address — missing @​

{
"email": "userexample.com"
}

Result:

{
"valid": false,
"reason": "Missing '@' separator between local part and domain."
}

Invalid address — no TLD​

{
"email": "user@localhost"
}

Result:

{
"valid": false,
"reason": "Domain must contain at least one dot separating labels (e.g. 'example.com')."
}

Errors​

Each failure carries a precise code in the response. Argument-schema and server errors are JSON-RPC protocol errors; a rejected value is returned as a tool result with isError: true (so the agent can read the code and self-correct).

An invalid email is not an error — the tool returns valid: false with a reason. Only an ill-formed request or a server fault can fail.

CodeWhenDelivered as
invalid_argumentsAn argument is missing or the wrong type.protocol error (invalid_params)
internal_errorAn unexpected server error.protocol error (internal_error)

Notes​

  • Validation is purely structural — no DNS or MX-record lookup is performed. A syntactically valid address may still be undeliverable.
  • Leading and trailing whitespace is ignored before validation.
  • The check is case-insensitive (both User@Example.COM and user@example.com are accepted).