Skip to main content
Glama

Pair Account

wa_pair_account

Begin linking a new WhatsApp account — or a Telegram account, with network set to telegram. For WhatsApp there are two ways to link and the right one depends on the user's devices, so ASK FIRST: if they can scan a QR code from another screen (a second phone, or this computer's screen) using the WhatsApp app on their phone, call this with no phone and show the returned QR PNG; if they only have the one phone that runs WhatsApp — it cannot scan its own screen — pass phone in international format to get an 8-character code they type on that phone instead. A Telegram account links by QR only, scanned from Telegram → Settings → Devices → Link Desktop Device; if it 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). Then poll wa_pair_status with the returned pair_id: a QR re-arms about every 20 seconds (show the newest each time), a phone code lasts a few minutes, and either way the state turns "paired" once it is linked. Pass import_history to choose whether a WhatsApp pairing loads the phone's recent messages as history.

Input Schema

NameRequiredDescriptionDefault
phoneNolink by phone-number code instead of a QR: the number to link, in international format with its country code (for example +52 998 123 4567). WhatsApp on that phone is asked to accept an 8-character code, returned as pair_code. Use it when the user has only the one phone that runs WhatsApp and cannot scan a QR from another screen (WhatsApp only)
networkNothe messaging network of the account to link: whatsapp (the default) or telegram. A Telegram account links by QR only: the user scans it from Telegram → Settings → Devices → Link Desktop Device. Telegram accounts must be enabled for the workspace, or the call is refused
import_historyNoimport the phone's recent message history (about two months) as read-only history for this pairing; omit to use the workspace default (WhatsApp only)

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. Changed1 schema field changed
    • changedOutput schema / properties / refusal / properties / account_status / description
      Previous value: -"when the number is not working: its status — starting, not_running, whatsapp_down, suspended, pairing, unlinked or locked"New value: +"when the number is not working: its status — starting, not_running, whatsapp_down (telegram_down for a Telegram account), suspended, pairing, unlinked or locked"
  2. Changed1 schema field changed
    • addedOutput schema / properties / refusal / properties / candidates
      Added value: +{
      +  "description": "on an account_ambiguous refusal: the accounts to choose from — retry with one of these as account_id",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "account_id": {
      +        "description": "the id to retry with as account_id",
      +        "type": "string"
      +      },
      +      "name": {
      +        "description": "the account's WhatsApp display name",
      +        "type": "string"
      +      },
      +      "phone": {
      +        "description": "the account's phone number, E.164",
      +        "type": "string"
      +      },
      +      "status": {
      +        "description": "whether the number works right now — live, connecting, or why not, as wa_list_accounts reports it",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "account_id"
      +    ],
      +    "type": "object"
      +  },
      +  "type": [
      +    "null",
      +    "array"
      +  ]
      +}
  3. Changed5 schema fields changed
    • changedInput schema / properties / import_history / description
      Previous value: -"import the phone's recent message history (about two months) as read-only history for this pairing; omit to use the workspace default"New value: +"import the phone's recent message history (about two months) as read-only history for this pairing; omit to use the workspace default (WhatsApp only)"
    • addedInput schema / properties / network
      Added value: +{
      +  "description": "the messaging network of the account to link: whatsapp (the default) or telegram. A Telegram account links by QR only: the user scans it from Telegram → Settings → Devices → Link Desktop Device. Telegram accounts must be enabled for the workspace, or the call is refused",
      +  "type": "string"
      +}
    • changedInput schema / properties / phone / description
      Previous value: -"link by phone-number code instead of a QR: the number to link, in international format with its country code (for example +52 998 123 4567). WhatsApp on that phone is asked to accept an 8-character code, returned as pair_code. Use it when the user has only the one phone that runs WhatsApp and cannot scan a QR from another screen"New value: +"link by phone-number code instead of a QR: the number to link, in international format with its country code (for example +52 998 123 4567). WhatsApp on that phone is asked to accept an 8-character code, returned as pair_code. Use it when the user has only the one phone that runs WhatsApp and cannot scan a QR from another screen (WhatsApp only)"
    • addedOutput schema / properties / network
      Added value: +{
      +  "description": "the messaging network the pairing links on: whatsapp or telegram",
      +  "type": "string"
      +}
    • changedOutput schema / properties / state / description
      Previous value: -"starting, qr, code, paired or failed"New value: +"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"
  4. Changed1 schema field changed
    • changedInput schema / properties / phone / description
      Previous value: -"link by phone-number code instead of a QR: the number to link, in international format with its country code (for example +52 998 123 4567). WhatsApp on that phone is asked to accept an 8-character code, returned as pair_code. Use it when the user has only that phone and cannot scan a QR"New value: +"link by phone-number code instead of a QR: the number to link, in international format with its country code (for example +52 998 123 4567). WhatsApp on that phone is asked to accept an 8-character code, returned as pair_code. Use it when the user has only the one phone that runs WhatsApp and cannot scan a QR from another screen"
  5. Changed7 schema fields changed
    • addedInput schema / properties / phone
      Added value: +{
      +  "description": "link by phone-number code instead of a QR: the number to link, in international format with its country code (for example +52 998 123 4567). WhatsApp on that phone is asked to accept an 8-character code, returned as pair_code. Use it when the user has only that phone and cannot scan a QR",
      +  "type": "string"
      +}
    • addedOutput schema / properties / expires_at
      Added value: +{
      +  "description": "when pair_code stops working, RFC 3339 (phone-number pairing only)",
      +  "type": "string"
      +}
    • addedOutput schema / properties / pair_code
      Added value: +{
      +  "description": "the 8-character code the user types on their phone (phone-number pairing only)",
      +  "type": "string"
      +}
    • addedOutput schema / properties / refusal / properties / account_status
      Added value: +{
      +  "description": "when the number is not working: its status — starting, not_running, whatsapp_down, suspended, pairing, unlinked or locked",
      +  "type": "string"
      +}
    • addedOutput schema / properties / refusal / properties / account_status_reason
      Added value: +{
      +  "description": "the detail of account_status, e.g. no_egress, stopped, no_plan",
      +  "type": "string"
      +}
    • addedOutput schema / properties / refusal / properties / since
      Added value: +{
      +  "description": "when the number stopped working, RFC3339, when known",
      +  "type": "string"
      +}
    • changedOutput schema / properties / state / description
      Previous value: -"starting, qr, paired or failed"New value: +"starting, qr, code, paired or failed"
  6. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only say non-read-only, non-idempotent, non-destructive, which says almost nothing about this interactive flow. The description adds substantial operational detail beyond them: a re-arming QR every ~20 seconds, a phone code valid 'a few minutes', a password_needed state for Telegram two-step verification (with the password entered on the console page, never via a tool), and the transition to 'paired'.

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?

Front-loaded with the purpose and then the decision rule, and nearly every clause is decision-relevant. It is a single dense paragraph rather than clearly segmented branches, which costs a point on structure, but there is little pure 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?

An output schema exists, so return values need not be explained, yet the description still tells the agent what comes back (QR PNG, pair_code, pair_id) and how to continue. Timing lifetimes, terminal state, and the password_needed exception complete the flow an agent needs to drive this correctly.

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 coverage is 100% and each parameter already carries a rich description, so the description mostly restates the same rules (phone in international format, telegram enables QR-only, import_history for WhatsApp history). It adds marginal value by framing phone absence as the QR trigger, but not enough to exceed the baseline when the schema already does the work.

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?

Opens with a specific verb and resource ('Begin linking a new WhatsApp account — or a Telegram account'), and the scope covers both networks in one sentence. It is plainly distinguishable from siblings like wa_pair_status and wa_unpair_account, which are named or implied elsewhere in the text.

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?

Explicitly instructs to ASK FIRST, then branches on user device constraints: QR when another screen is available, phone code when the user has only the one phone ('it cannot scan its own screen'). Telegram is scoped to QR only and the polling handoff to wa_pair_status is stated outright.

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