capture_email_code
Provision a temporary email address, wait for a 4-8 digit verification code, and release the address. Returns the email to paste into signup forms and the captured code.
Instructions
All-in-one email verification capture: provision an email address, wait for an incoming verification code (4-8 digits by default), release the address. Use for services that email verification codes instead of SMS.
Returns email_address (paste into the signup form) and code (the
captured verification code). code is null on timeout.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| local_part | No | ||
| timeout | No | ||
| release_after | No |
Implementation Reference
- agentline_mcp/server.py:355-385 (handler)The `capture_email_code` tool handler — provisions an email address, waits for a verification code (4-8 digits), and optionally releases the address. This is the core implementation of the tool, decorated with @mcp.tool().
@mcp.tool() def capture_email_code( local_part: str | None = None, timeout: float = DEFAULT_WAIT_TIMEOUT, release_after: bool = True, ) -> dict: """All-in-one email verification capture: provision an email address, wait for an incoming verification code (4-8 digits by default), release the address. Use for services that email verification codes instead of SMS. Returns `email_address` (paste into the signup form) and `code` (the captured verification code). `code` is null on timeout. """ try: client = _client_or_init() addr = client.create_email_address(local_part=local_part) try: code = client.get_email_verification_code( addr.email_address, timeout=_clamp_timeout(timeout), ) return { "email_address": addr.email_address, "code": code, "released": release_after, } finally: if release_after: client.release_email_address(addr.id) except AgentlineError as e: return {"error": str(e), "status_code": e.status_code} - agentline_mcp/server.py:355-355 (registration)The `@mcp.tool()` decorator on `capture_email_code` registers it as an MCP tool on the FastMCP 'agentline' server.
@mcp.tool() - agentline_mcp/server.py:58-59 (helper)Helper `_clamp_timeout` clamps the timeout between 1.0 and MAX_WAIT_TIMEOUT (180s), used by `capture_email_code`.
def _clamp_timeout(timeout: float) -> float: return max(1.0, min(float(timeout), MAX_WAIT_TIMEOUT)) - agentline_mcp/server.py:51-55 (helper)Helper `_client_or_init` returns a cached Agentline SDK client, used by `capture_email_code` to make API calls.
def _client_or_init() -> Agentline: global _client if _client is None: _client = _build_client() return _client