get_2fa_code
Retrieves a 2FA OTP code from Twilio SMS after triggering the send. Polls until a message matching the app keyword arrives, then extracts and returns the code.
Instructions
Fetch a 2FA OTP code from Twilio SMS — call this AFTER clicking 'Send Code'.
Polls the Twilio Messages API until a new SMS matching app_keyword arrives, then extracts and returns the OTP code. Twilio credentials are read from .env and never exposed in tool responses.
Call this tool AFTER triggering the 2FA send in the browser. The baseline inbox state is captured at call time; Twilio delivery latency (2-10s) gives sufficient buffer before the first poll.
Args: app_keyword: Case-insensitive keyword to match in the SMS body. Use the site name, e.g. 'paycom', 'chase', 'google'. code_pattern: Regex to extract the OTP. Default: 6-digit number. Override for 8-digit or alphanumeric codes. timeout: Seconds to wait for the code before giving up. Default: 60.
Required .env entries: TWILIO_ACCOUNT_SID — Twilio Account SID TWILIO_AUTH_TOKEN — Twilio Auth Token TWILIO_PHONE_NUMBER — Digits-only recipient number (e.g. 14155551234)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app_keyword | Yes | ||
| code_pattern | No | \d{6} | |
| timeout | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |