Skip to main content
Glama

Wait for swap update

wait_for_swap
Read-only

Wait for a swap to change stage or finish, then return its status, stage, outcome, and transaction IDs; call repeatedly after starting a swap until done is true.

Instructions

Wait until a swap's stage changes or it finishes, then return its status. Read-only: it watches this kit's local swap record while the swap runs in the background. After swap_asset_to_bsv, call it repeatedly until swap.done is true; a swap usually finishes within about an hour. Returns changed (false when the wait ended with no change, which is normal: call again), waited_seconds, and swap, the same view swap_status gives: stage, stage_label, step and steps_total, done, outcome (delivered, settled, refunded or failed), eta_minutes and txids with explorer links. Sends progress notifications when the client supplies a progress token. Use swap_status for an instant read.

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": {
      "swap_id": "<swap_id>"
    },
    "name": "wait_for_swap"
  }
}

Input Schema

NameRequiredDescriptionDefault
swap_idYesThe swap_id returned by swap_asset_to_bsv or listed by swap_status.
max_wait_secondsNoOptional longest wait in whole seconds, from 1 to 55. Default 50.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.2.22
    • addedInput schema / properties / max_wait_seconds / description
      Added value: +"Optional longest wait in whole seconds, from 1 to 55. Default 50."
    • addedInput schema / properties / max_wait_seconds / maximum
      Added value: +55
    • addedInput schema / properties / max_wait_seconds / minimum
      Added value: +1
    • changedInput schema / properties / max_wait_seconds / type
      Previous value: -"number"New value: +"integer"
    • addedInput schema / properties / swap_id / description
      Added value: +"The swap_id returned by swap_asset_to_bsv or listed by swap_status."
  2. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the readOnlyHint and openWorldHint annotations, the description explains that it watches this kit's local swap record while the swap runs in the background, describes the returned fields, notes that changed=false is normal, and mentions progress notifications when a progress token is supplied.

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 description is front-loaded with the purpose and wait behavior, then proceeds to usage, return values, notifications, and the sibling alternative. It is dense but every sentence adds relevant information for an asynchronous wait tool with no output 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?

Given the complexity of an asynchronous wait operation, no output schema, and fully documented parameters, the description is complete: it covers when to call, how often, expected duration, return fields, the meaning of no-change results, notifications, and the instant-read alternative.

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%, so both parameters are already fully documented in the input schema. The description does not add syntax or constraints for max_wait_seconds beyond what the schema provides, so the baseline of 3 is appropriate.

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?

The description states a specific verb and resource: wait until a swap's stage changes or it finishes, then return its status. It also distinguishes this from swap_status with 'Use swap_status for an instant read,' so an agent can select it without opening either 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?

It gives explicit usage guidance: call it repeatedly after swap_asset_to_bsv until swap.done is true, and expect about an hour. It also names the alternative swap_status for an instant read, and explains that changed=false is normal and means call again.

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