start_login
Initiates a login session by sending an authentication challenge through Telegram, WhatsApp, SMS, or email, then returns a session ID to poll until the user completes sign-in.
Instructions
Start a login session by sending an authentication challenge to the user's chosen channel (Telegram, WhatsApp, SMS, or email). Returns a session ID and, FOR TELEGRAM AND WHATSAPP ONLY, deep_link, qr_code (base64 PNG) and qr_text (UTF-8 text QR for terminal display); on sms it returns sms_message with sms_dids instead, and on email nothing to display.
Agent usage: (1) Call start_login with the desired channel and phone_number (for SMS) or email (for email). (2) Present the challenge, and WHICH FIELD depends on the channel. On telegram/whatsapp pass deep_link to render_auth_link, which returns the clickable link and a QR code to you; in a chat client the link is what the user acts on, since they are usually on the same machine. On sms deep_link is an EMPTY STRING and render_auth_link will reject it — show sms_message and let the user pick a number from sms_dids. suggested_region is always set, but the matching ENTRY in sms_dids may be missing (europe and israel appear only when a number is configured) or present with an empty did, so offer that region first only when sms_dids[suggested_region] exists and carries a number, and otherwise offer whatever the object does. On email there is nothing to display at all, and nothing to check either: a result means the mail was accepted for delivery, so tell the user to open their inbox. A delivery failure is an ERROR here, not a field — the tool answers challenge_delivery_failed and NO session exists, so do not call wait_for_login; retry, or offer another channel. Never hand qr_text to a link renderer — it is the link already rendered as QR art, so print it verbatim inside a fenced code block or not at all, because its rows stop scanning the moment one wraps or a blank line lands between them. (3) Once your reply shows the user the challenge, call wait_for_login with the returned session ID to poll until the user completes authentication. On email, tell the user to open the link and press "Sign in the browser that requested this": the page also offers "Sign in here", which signs in the browser they clicked from instead of this connection. Terminal states: "verified" (login succeeded), "failed", "expired", "completed_elsewhere" (email only: the user pressed "Sign in here" on the email link's page, so the browser they clicked from is signed in and this connection never will be — tell them so, and start a new login if this connection still needs one).
The user does not see tool results — most clients fold them away, render_auth_link's output included. Before you wait or poll, put what the user must act on into your own reply text: the link itself (not a sentence announcing it), the SMS text and number, or a note to check their inbox.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| No | Email address (required for email channel) | ||
| channel | Yes | Authentication channel | |
| phone_number | No | Phone number in E.164 format (required for SMS channel) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | ||
| type | No | ||
| status | No | Status of an auth session. `completed_elsewhere` (terminal, no cookies): an email sign-in the person completed in ANOTHER browser by pressing "Sign in here" on the link's page — this session will never become `verified`. | |
| channel | No | Authentication channel | |
| qr_code | No | Base64-encoded QR code image | |
| qr_text | No | UTF-8 text representation of the QR code for terminal/agent display | |
| user_id | No | ||
| deep_link | No | ||
| expires_at | No | ||
| verified_at | No | ||
| instructions | No |