Skip to main content
Glama
jan3dev

Agentic AQUA

by jan3dev

lightning_refund

Recover L-BTC locked by a failed Lightning send swap and return it to the swap wallet or a chosen Liquid address. Preview with dry_run, or broadcast a cooperative refund or one after the timeout.

Instructions

Recover the L-BTC locked up by a failed Lightning send swap, back to the swap's own wallet (or a given Liquid address). Works with both providers. A cooperative refund is cosigned by the provider and works right away; if the provider declines, the refund branch can be spent on its own once the timeout block passes. claim_public_key and blinding_key only need supplying for swaps created before those fields were stored locally — the error message says when that applies.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressNoLiquid destination address; defaults to a new address of the swap's wallet
dry_runNoBuild and sign the refund but do not broadcast it (default false)
swap_idYesSwap ID returned from lightning_send
blinding_keyNoLockup blinding key (hex), for legacy swaps only
claim_public_keyNoProvider's claim public key (hex), for legacy swaps only

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.5.2

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does well: it explains the cooperative cosigned refund path versus the timeout-based refund branch, and notes the legacy-only need for claim_public_key/blinding_key with a pointer to the error message. It omits auth/permission requirements and does not explicitly state that a transaction is broadcast, but the dry_run parameter and refund mechanics make the mutation nature clear.

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 description is front-loaded with the core action, then adds the two refund paths and legacy-key caveat. Four sentences, all informative, with no filler, though it is dense and could be slightly tighter.

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

Completeness4/5

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

For a 5-parameter mutation tool with no output schema, the description covers the refund mechanics, default address behavior, dry-run option, and legacy key requirement well. It does not describe the return value or authorization needs, which leaves minor gaps for an agent to infer.

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 every parameter. The description adds little beyond the schema, repeating the 'legacy swaps only' condition for claim_public_key and blinding_key, though it usefully notes the error message indicates when those fields apply.

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 ('Recover') and resource ('L-BTC locked up by a failed Lightning send swap') with clear scope, and distinguishes itself from lightning_send and lightning_transaction_status by focusing on reclaiming failed-swap funds rather than initiating or checking sends.

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?

The description clearly implies the triggering context: use this after a Lightning send swap has failed and L-BTC is locked. It does not explicitly name alternative tools or state when not to use it, but the failure condition is unambiguous.

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