Skip to main content
Glama

Create a swap

create_swap

Create the swap and get the deposit address. No funds move here: the user then sends amount_from of from_asset to deposit_address (with deposit_extra_id as the memo, when present), as instructions says. Follow it with get_swap.

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>",
      "address": "<address>"
    },
    "name": "create_swap"
  }
}

Input Schema

NameRequiredDescriptionDefault
emailNoThe user's email, when the chosen quote has email_required.
amountNoAmount of from_asset the user sends. Pass this or amount_to.
addressYesThe user's payout address for to_asset, as they gave it.
rate_idNoThe chosen quote's rate_id (fixed rate).
extra_idNoMemo/tag for the payout address, if the user's wallet needs one (XRP, XLM...).
providerNoThe chosen quote's provider. Without it: the best quote now, then the next best, among exchanges without a notice.
to_assetYesAsset the user receives.
amount_toNoExact amount of to_asset to receive, instead of amount (fixed rate only): the result's amount_from is what the user must send.
rate_typeNo'float' or 'fixed'. Default float, or fixed with amount_to.
from_assetYesAsset the user sends.
to_networkNoNetwork of to_asset, when its ticker is on several.
from_networkNoNetwork of from_asset, when its ticker is on several.
refund_addressNoThe user's from_asset address, for a refund if the swap fails.
idempotency_keyNoA UUID made once per swap. A retry with the same one and the same arguments returns the swap already made.
refund_extra_idNoMemo/tag for the refund address.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Annotations only declare destructiveHint=false, so the description carries the real burden, and it delivers the non-obvious behavioral core: creating the swap moves no funds, the user must send the asset to the returned deposit address, and the memo (deposit_extra_id) must be included when present. It also names the returned fields (deposit_address, deposit_extra_id), which matters because there is no output schema.

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?

Brief and front-loaded: creation and its non-obvious consequence come first, followed by the hand-off to get_swap. The trailing 'as instructions says' is awkward filler that could be dropped without losing meaning.

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 15-parameter mutation with no output schema and thin annotations, the description covers the essential state machine and names the key return values. It stops short of covering edge behaviors like fixed-rate expiry or refund handling, though those are partially addressed by the schema's parameter descriptions.

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 15 parameters are already documented in the schema, establishing a baseline of 3. The description adds no parameter-level meaning beyond mentioning response fields, and it uses 'amount_from', a name that does not match the input parameter 'amount'/'amount_to', creating mild ambiguity.

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 ('Create the swap') plus the concrete immediate outcome ('get the deposit address'), and explicitly scopes out any fund movement. Naming get_swap as the follow-up separates it cleanly from the read-side sibling.

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?

Explains the post-creation flow ('the user then sends amount_from of from_asset to deposit_address ... Follow it with get_swap'), which tells the agent what to do next. It does not explicitly say a quote must be obtained first (get_quotes) — that prerequisite is only implied through terms like 'the chosen quote' that live in the schema.

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