Skip to main content
Glama

Prepare Swap

prepare_swap
Read-onlyIdempotent

Build a ready-to-execute THORChain swap. Returns the exact vault address to send to, the memo, the source chain, the expected output and guaranteed minimum, the estimated time, and an expiry. Use this when the user wants to actually perform a swap, not just price it (for pricing only, use quote_swap). The returned instruction is what a wallet signs and broadcasts; this tool itself never moves funds.

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": {
      "from_asset": "<from_asset>",
      "to_asset": "<to_asset>",
      "amount": "<amount>",
      "destination": "<destination>"
    },
    "name": "prepare_swap"
  }
}

Input Schema

NameRequiredDescriptionDefault
amountYesAmount to swap in THORChain base units (1e8; e.g. 50000000 = 0.5 BTC)
to_assetYesThe target asset to swap to (e.g. ETH.ETH)
affiliateNoOptional affiliate address or THORName that collects a fee
from_assetYesThe source asset to swap from (e.g. BTC.BTC)
destinationYesThe address on the destination chain that will receive the swap output. Required to execute a swap.
affiliate_bpsNoOptional affiliate fee in basis points (0-1000; protocol caps total affiliate fees at 1000 bps)
max_slippage_bpsNoMaximum acceptable slippage in basis points; sets the min-received limit baked into the memo (default 300 = 3%). Range 1-10000.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Goes beyond the annotations by describing the return payload (vault address, memo, source chain, expected output, guaranteed minimum, estimated time, expiry) and by clarifying the safety model: the tool only produces an instruction a wallet signs and broadcasts and never moves funds, which is consistent with readOnlyHint=true. It does not address expiry duration semantics, affiliate fee behavior, or failure modes, which keeps it short of a 5.

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?

Three sentences, each earning its place: what it does and returns, when to use it versus the alternative, and the safety boundary. The most decision-relevant information (execute vs. price) is placed early.

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?

There is no output schema, so the description carries the burden of explaining return values, and it does so by naming every field the agent needs to act on. For a 7-parameter, fully documented read-style tool, nothing essential 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 all seven parameters are already documented in the schema, including base units, affiliate bps, and slippage range. The description adds only indirect context by mentioning that the returned instruction includes a guaranteed minimum and an expiry, which are the downstream effects of max_slippage_bps. Baseline 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?

States a specific verb and resource ('Build a ready-to-execute THORChain swap') and immediately enumerates what the artifact contains. It explicitly distinguishes itself from the sibling quote_swap, so an agent can separate the two without opening a 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?

Gives an explicit when-to-use rule ('when the user wants to actually perform a swap, not just price it') and names the alternative tool plus the condition that selects it ('for pricing only, use quote_swap'). Nothing is left to inference.

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.

Resources