Skip to main content
Glama

wait_for_session

Read-only

Poll a session until it reaches a terminal state (verified, failed, or expired). Uses exponential backoff (2s initial, 1.5x, 30s max) with jitter.

Before calling this for a challenge you created, make sure your reply text already shows the user what to act on — the link itself, the SMS text and number, or a note to check their inbox; a link that appeared only in a tool result is one they never saw.

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": {
      "id": "<id>"
    },
    "name": "wait_for_session"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesSession ID to poll
timeout_secondsNoMaximum wait time in seconds (default: 50, max: 300). 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
idNoSession id
proofNoProof token after successful verification
statusNo"pending" when the wait ran out before a terminal state; otherwise the resource's own status
channelNoHow the person proves the number: `telegram` or `whatsapp` (the bot reads the number from their account), or `sms` (they text a short code from the number to one of ours).
messageNoOn timeout: what to do next (call the tool again with the same identifier)
created_atNo
last_statusNoOn timeout: the last non-terminal status observed, or null when none was
verified_atNoOnce `verified`
phone_numberNoThe proven number (once `verified`)
waited_secondsNoOn timeout: seconds actually waited
timeout_secondsNoOn timeout: the wait budget this call was given
verification_idNoThe verification record created on completion (once `verified`)

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": {
      +    "channel": {
      +      "description": "How the person proves the number: `telegram` or `whatsapp` (the bot reads the number from their account), or `sms` (they text a short code from the number to one of ours)."
      +    },
      +    "created_at": {},
      +    "id": {
      +      "description": "Session 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)"
      +    },
      +    "phone_number": {
      +      "description": "The proven number (once `verified`)"
      +    },
      +    "proof": {
      +      "description": "Proof token after successful verification"
      +    },
      +    "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"
      +    },
      +    "verification_id": {
      +      "description": "The verification record created on completion (once `verified`)"
      +    },
      +    "verified_at": {
      +      "description": "Once `verified`"
      +    },
      +    "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?

Annotations declare readOnlyHint=true and the description is consistent, then goes well beyond them: it discloses the exponential backoff curve (2s/1.5x/30s with jitter), the auth pre-requisite and the exact recovery path (authenticate then retry), the client-timeout truncation behavior, and the 'pending' answer on timeout. That is exactly the operational 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.

Conciseness4/5

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

Front-loaded with purpose first, then the UX pre-condition, then the auth note, in three tight paragraphs with no filler. Slightly bulky for a two-parameter tool, but every sentence carries information an agent needs.

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?

Output schema exists so return values need not be explained, annotations cover the safety profile, and the description still supplies the auth requirement, polling/backoff behavior, and the timeout recovery loop. Nothing an agent needs in order to call and re-call this tool correctly is missing.

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 schema already documents both parameters including the 300s cap and the default of 50. The description adds no parameter-level detail beyond what is already in the schema (the 'pending' retry note is duplicated there), so the baseline of 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?

States a specific verb (poll) and resource (a session) plus the three terminal states it waits for, which is far more precise than the sibling get_session. It does not explicitly name the nearest alternatives in the wait_for_* family (wait_for_verification, wait_for_confirmation), leaving the agent to infer the distinction from the noun 'session'.

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?

Gives concrete when-to-call guidance: it must be invoked only after the reply text already shows the user the actionable link/SMS/inbox note, which is a real pre-condition. It also explains the timeout-retry loop. It stops short of naming alternatives such as get_session for a one-shot check, so it does not reach a 5.

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.