Skip to main content
Glama

wait_for_chat_id_discovery

Read-only

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 an approval channel 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. Authenticate this client (Claude Code: /mcp → Authenticate), then call this tool again. start_login does NOT open this tool.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "token": "<token>"
    },
    "name": "wait_for_chat_id_discovery"
  }
}

Input Schema

NameRequiredDescriptionDefault
tokenYesDiscovery token from create_chat_id_discovery
timeout_secondsNoMaximum 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

NameRequiredDescriptionDefault
statusNo"pending" when the wait ran out before a terminal state; otherwise the resource's own status
chat_idNo
messageNoOn timeout: what to do next (call the tool again with the same identifier)
last_statusNoOn timeout: the last non-terminal status observed, or null when none was
waited_secondsNoOn timeout: seconds actually waited
timeout_secondsNoOn timeout: the wait budget this call was given

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": {},
      +  "properties": {
      +    "chat_id": {},
      +    "last_status": {
      +      "description": "On timeout: the last non-terminal status observed, or null when none was"
      +    },
      +    "message": {
      +      "description": "On timeout: what to do next (call the tool again with the same identifier)"
      +    },
      +    "status": {
      +      "description": "\"pending\" when the wait ran out before a terminal state; otherwise the resource's own status"
      +    },
      +    "timeout_seconds": {
      +      "description": "On timeout: the wait budget this call was given"
      +    },
      +    "waited_seconds": {
      +      "description": "On timeout: seconds actually waited"
      +    }
      +  },
      +  "type": "object"
      +}
  2. Changed1 schema field changed
    • removedInput schema / additionalProperties
      Removed value: -false
  3. First observed

TDQS

A4.1/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond readOnlyHint=true, it discloses backoff parameters (2s initial, 1.5x, 30s max, jitter), terminal states, the "pending" retry contract, and the client-timeout risk that cuts off a long wait while the server is still polling. It also discloses an access prerequisite (Proof account authentication, and that start_login does not unlock this tool) and the non-obvious fact that users never see tool output, which changes how the agent must reply.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose and backoff are front-loaded, then usage sequencing, then the terminal-state contract, then the user-visibility caveat. Every paragraph carries actionable content, though the ordering buries the user-visibility instruction last and the ACCESS paragraph reads as boilerplate relative to the polling mechanics.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite an output schema existing, the description still clarifies what the status values mean in decision terms (completed vs expired vs pending), which is the part an agent needs to branch on. Auth prerequisites, timeout behavior, and the rendering caveat are all covered, leaving no material gap for a two-parameter long-poll tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the token and timeout_seconds semantics are already documented in the schema, including the 600s cap and the client-timeout caveat. The description adds little param-level meaning beyond restating that the returned token is used; baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence gives a specific verb and resource: poll a chat ID discovery token until the user interacts with the Telegram bot, plus the backoff policy. It does not distinguish itself from the sibling poll_chat_id_discovery, which by name appears to do a non-blocking single poll, so the agent still has to guess which polling flavor to pick.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It prescribes a concrete sequence: call after create_chat_id_discovery, render `deep_link` with render_auth_link first, then poll with the returned token. It also explains what each terminal state means. It stops short of explicit when-not guidance or naming an alternative for a one-shot check.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.