Skip to main content
Glama

swap_cancel

Cancel an open swap before it executes. Use to abort an RFQ when limit not met, user changed mind, or to clean up a stale swap handle.

Instructions

Abort an open swap before it executes (cancels the underlying RFQ). No funds were locked. Use when the limit never meets, the user changed their mind, or to clean up a stale swap_handle.

USE WHEN: backing out of a swap_quote that has not been executed. DO NOT USE WHEN: the swap already executed (a trade exists) — settlement is governed by the HTLC timelock, not this tool.

PARAM NOTES: idempotent within a session via client_request_id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
swap_handleYesThe swap_handle (RFQ id) to cancel.
client_request_idNoIdempotency key. Best-effort within this session.
Behavior5/5

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

Despite no annotations, the description discloses key behaviors: no funds locked, idempotency via client_request_id, and that settlement for executed swaps is governed by HTLC timelock. No contradictory information.

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 concise, front-loaded with the main action, and uses bullet-style headers ('USE WHEN', 'DO NOT USE WHEN', 'PARAM NOTES') for clarity. Every sentence adds value with no redundancy.

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 tool's simplicity and lack of output schema, the description covers all necessary aspects: purpose, usage conditions, parameter notes, and idempotency. No gaps are apparent.

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 description adds only incremental value by explaining swap_handle as 'RFQ id' and client_request_id as 'Idempotency key. Best-effort within this session.' This is helpful but not essential.

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 uses a specific verb ('Abort') and resource ('open swap'), clearly distinguishing from sibling tools like swap_execute or swap_quote. It also clarifies no funds are locked.

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?

Explicitly states when to use (backing out of unexecuted swap_quote) and when not to use (swap already executed), with examples like limit not met or user changed mind. Provides clear exclusion criteria.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Hashlock-Tech/hashlock-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server