Skip to main content
Glama

WhatsMCP: MCP for WhatsApp

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
    • 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"
      +  ]
      +}
  2. 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"
  3. 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"
  4. Changed3 schema fields changed
    • 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"
      +}
  5. Changed4 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"
      +}
    • changedOutput schema / properties / state / description
      Previous value: -"starting, qr, paired or failed"New value: +"starting, qr, code, paired or failed"
  6. Changed1 schema field changed
    • addedInput schema / properties
      Added value: +{
      +  "import_history": {
      +    "description": "import the phone's recent message history (about two months) as read-only history for this pairing; omit to use the workspace default",
      +    "type": [
      +      "null",
      +      "boolean"
      +    ]
      +  }
      +}
  7. Changed1 schema field changed
    • addedOutput schema / properties / needs_plan
      Added value: +{
      +  "description": "true when the linked number has no plan yet and will not run until the user buys one in the console",
      +  "type": "boolean"
      +}
  8. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare the non-read-only, non-idempotent, non-destructive profile; the description adds substantial context beyond that: QR re-arms roughly every 20 seconds and the newest must be shown, phone codes last a few minutes, Telegram two-step verification flips state to password_needed with the password entered on the console pairing page and never through a tool, and Telegram accounts must be enabled for the workspace or the call is refused. These are operational traits an agent cannot infer from the annotations.

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?

The core instruction ('ASK FIRST' plus the two-linking-methods branch) is front-loaded, and the sentence about polling and state transitions comes after. It is dense and long, but nearly every clause carries a rule the agent must apply; a small amount of the QR/phone description could be trimmed given the schema.

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?

Covers everything needed for a pairing tool: which inputs to pass in which situation, the Telegram constraints, the follow-up polling behavior, timing windows, and the terminal 'paired' state. Return values are partly described (QR PNG, pair_code, pair_id) and an output schema exists, so nothing essential is missing.

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?

Schema coverage is 100%, so the baseline is 3 and the schema already carries format details. The description still adds decision-level meaning by tying phone to the single-device case and import_history to choosing whether WhatsApp history loads, though it largely restates what the schema fields say rather than extending them.

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+resource ('Begin linking a new WhatsApp account') and immediately qualifies the scope with the Telegram variant ('or a Telegram account, with network set to telegram'). This clearly separates it from wa_pair_status (polling) and wa_unpair_account (teardown) without the agent needing to open sibling schemas.

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?

Gives an explicit decision procedure: 'ASK FIRST', then branch on whether the user can scan a QR from another screen versus having only one phone. It names the alternative call path (pass phone for a code), the Telegram-only path, and the required follow-up ('Then poll wa_pair_status with the returned pair_id'), so both when-to-use and what-comes-next are spelled out.

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