Pair Telegram Account
tg_pair_accountBegin linking a new Telegram account. It links by QR only: show the returned QR PNG and ask the user to open Telegram on a phone signed in to the account, go to Settings → Devices → Link Desktop Device, and scan it from a SECOND screen. Then poll tg_pair_status with the returned pair_id: a QR re-arms about every 30 seconds (show the newest each time) and the state turns "paired" once it is linked. If the account has two-step verification the state becomes password_needed and the user enters their cloud password on the console's pairing page, never through a tool. To link a WhatsApp number use wa_pair_account instead.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "tg_pair_account"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| state | Yes | starting, qr, code, password_needed (a Telegram account with two-step verification: the user must enter their cloud password on the console's pairing page — never ask for it here), paired or failed | |
| network | No | the messaging network the pairing links on: whatsapp or telegram | |
| pair_id | No | pass this to wa_pair_status to follow the pairing | |
| refusal | No | present only when pairing could not be started | |
| pair_code | No | the 8-character code the user types on their phone (phone-number pairing only) | |
| expires_at | No | when pair_code stops working, RFC 3339 (phone-number pairing only) | |
| needs_plan | No | true when the linked number has no plan yet and will not run until the user buys one in the console | |
| instructions | No | what to tell the user to do | |
| qr_png_base64 | No | a PNG image of the QR code, base64 encoded — display this to the user |