Skip to main content
Glama

Pair Telegram Account

tg_pair_account

Begin 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

NameRequiredDescriptionDefault

No arguments

Output Schema

NameRequiredDescriptionDefault
stateYesstarting, 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
networkNothe messaging network the pairing links on: whatsapp or telegram
pair_idNopass this to wa_pair_status to follow the pairing
refusalNopresent only when pairing could not be started
pair_codeNothe 8-character code the user types on their phone (phone-number pairing only)
expires_atNowhen pair_code stops working, RFC 3339 (phone-number pairing only)
needs_planNotrue when the linked number has no plan yet and will not run until the user buys one in the console
instructionsNowhat to tell the user to do
qr_png_base64Noa PNG image of the QR code, base64 encoded — display this to the user

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.9/5.0
Behavior5/5

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

Annotations only declare it is not read-only, not idempotent, not destructive; the description goes far beyond by disclosing the QR re-arm interval (~30s), the state machine ('paired', 'password_needed'), and the security constraint that the cloud password is entered on the console page, never via a tool. That is exactly the kind of lifecycle and credential-handling context annotations cannot carry.

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

Conciseness5/5

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

The action and the QR-only constraint come first, followed by the step-by-step user instructions, then polling, then the edge case, then the sibling pointer. Dense but every sentence carries a distinct instruction with no filler.

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?

For a zero-parameter tool with an output schema, the description supplies everything an agent needs operationally: how the user completes the flow, what to poll and with which id, how often to refresh, and how the two-step verification branch changes the interaction.

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

Parameters4/5

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

The tool takes zero parameters, so the baseline is 4. The description still adds useful semantics about the call's outputs (returned QR PNG and pair_id) that drive the handoff to tg_pair_status, though formal return values are covered by the output schema.

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

Purpose5/5

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

States a specific verb and resource ('Begin linking a new Telegram account') and immediately names the sibling it is not ('To link a WhatsApp number use wa_pair_account instead'). An agent can distinguish it from wa_pair_account and tg_pair_status without opening any schema.

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

Usage Guidelines5/5

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

Explicit routing: QR is the only method, then 'poll tg_pair_status with the returned pair_id', and WhatsApp goes to wa_pair_account. It also names the when-not case (password entry never happens through a tool) and the physical precondition (scan from a SECOND screen).

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.

Resources