Skip to main content
Glama

swap_refund

Refund a swap that failed to pay out: after an Arkade timelock, send funds to a specified Ark address; for stablecoin deposits, omit the address to return the deposit for recovery.

Instructions

Refund a swap that did not pay out. Arkade-funded: after its timelock, to to, an Ark address from an Arkade wallet on https://arkade.computer (Lightning swaps need no refund). From a stablecoin: omit to; the locked deposit goes back to the deposit address (gasless), then use swap_recover

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": "swap_refund"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYes
toNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations at all, the description carries the full behavioral burden and does a fair job: it discloses the timelock precondition, that the refund goes to an Ark address for Arkade-funded swaps, that stablecoin refunds are gasless and return to the deposit address, and that swap_recover is the next step. It does not say whether the call requires a signature/authorization from the depositor, whether the refund is irreversible, or what the call returns.

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

Conciseness3/5

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

It is short and the core purpose is front-loaded, but the style is telegraphic and run-on, relying on fragments, parentheses and backticked tokens ('Arkade-funded:', 'gasless') that require domain familiarity. A slightly more structured split of the two funding paths and the follow-up step would cost no extra length.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a fund-moving mutation with no annotations and no output schema, this covers the two main flows and the recovery follow-up, which is the essential context. It still leaves gaps an agent would want: authorization requirements, failure conditions (timelock not expired, swap already paid), and any indication of what a successful refund yields.

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 0%, so the description must explain both parameters. It does well on `to`, specifying it must be an Ark address from an Arkade wallet, and it states when to omit it entirely. However, `id` — the only required parameter — is never explained beyond being implied by 'a swap that did not pay out', leaving its meaning and provenance to inference.

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?

The opening sentence names a specific verb and resource, 'Refund a swap that did not pay out', which tells an agent exactly what the tool does and implicitly scopes it to failed swaps. It also positions itself relative to swap_recover as the follow-up step, though it does not contrast with escrow_refund or the other refund-flavored siblings.

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?

It gives concrete when-to-use conditions: Arkade-funded swaps after their timelock with a `to` address, versus stablecoin-funded swaps where `to` is omitted, and it explicitly excludes Lightning swaps ('need no refund'). It also states the follow-up action (swap_recover). What's missing is a clear statement of what happens if the timelock has not yet expired or if the swap actually did pay out.

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