wait_for_chat_id_discovery
Polls a Telegram discovery token until the user opens the bot link, returning when the chat ID is found or the token expires so you can configure human-in-the-loop approval.
Instructions
Poll a chat ID discovery token until the user interacts with the Telegram bot. Uses exponential backoff (2s initial, 1.5x, 30s max) with jitter.
Agent usage: Call this after create_chat_id_discovery. Present the discovery response's deep_link with render_auth_link first, then poll with the returned token. Terminal states: "completed" (chat_id discovered — use it when creating a HITL config with a Telegram channel), "expired". While "pending", the user has not yet opened the Telegram link.
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.
ACCESS: needs a Proof account. Set PROOF_API_KEY and restart this server, then call this tool again. start_login does NOT open this tool.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| token | Yes | Discovery token from create_chat_id_discovery | |
| timeout_seconds | No | Maximum wait time in seconds (default: 50, max: 600). Keep it under your MCP client's request timeout (the SDK default is 60 s) — a longer wait is cut off by the client while the server is still polling. On timeout the tool answers status "pending"; call it again with the same identifier. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| status | No | "pending" when the wait ran out before a terminal state; otherwise the resource's own status | |
| chat_id | No | ||
| message | No | On timeout: what to do next (call the tool again with the same identifier) | |
| last_status | No | On timeout: the last non-terminal status observed, or null when none was | |
| waited_seconds | No | On timeout: seconds actually waited | |
| timeout_seconds | No | On timeout: the wait budget this call was given |