Skip to main content
Glama

Swap tokens across chains

create_swap

Lock a quote and get a one-time deposit address. Send exactly send_exactly of the source token there and the output lands at recipient automatically, usually in under a minute. Non-custodial, no API key, no wallet connection, automatic refund on failure. For EVM sources, deposit_tx is a ready-to-sign transaction.

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_token": "<from_token>",
      "to_token": "<to_token>",
      "amount": "<amount>",
      "recipient": "<recipient>",
      "refund_address": "<refund_address>"
    },
    "name": "create_swap"
  }
}

Input Schema

NameRequiredDescriptionDefault
testNoTest mode: true = no real money. You get a fake deposit address that completes by itself in ~15s, so you can test status, invoices, receipts and webhooks for free.
speedNoOptional. Default 'best_price': Swap Ripper quotes two networks at once and uses whichever is cheaper for you (and the other if one fails); the reply's route_choice shows both. 'fast' forces the ~seconds Relay route.
amountYesAmount of from_token to send, as a human-readable decimal string, e.g. '25' or '0.015'. Not base units.
referrerNoOptional: your NEAR account (e.g. 'myagent.near'). You earn 1/3 of the service fee on every swap routed with it. The user pays the same.
to_chainNoChain to receive on.
to_tokenYesToken to receive (same formats as from_token).
recipientYesAddress that receives the output, ON THE DESTINATION CHAIN.
from_chainNoChain the token is sent from, e.g. 'solana', 'base', 'ethereum', 'bitcoin'. Needed when the symbol exists on several chains.
from_tokenYesToken to send: symbol ('USDC', 'ETH', 'BTC'), 'SYMBOL@chain', 'SYMBOL on chain', or an asset_id from search_tokens.
request_idNoRecommended: your own unique ID for this payment (e.g. a UUID). Retrying with the same request_id returns the SAME payment instructions, so you never pay twice.
slippage_bpsNoMax slippage in basis points (default 100 = 1%, range 10-500).
refund_addressYesAddress for automatic refunds, ON THE SOURCE CHAIN. Usually the sending wallet.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / request_id
      Added value: +{
      +  "description": "Recommended: your own unique ID for this payment (e.g. a UUID). Retrying with the same request_id returns the SAME payment instructions, so you never pay twice.",
      +  "type": "string"
      +}
    • addedInput schema / properties / speed
      Added value: +{
      +  "description": "Optional. Default 'best_price': Swap Ripper quotes two networks at once and uses whichever is cheaper for you (and the other if one fails); the reply's route_choice shows both. 'fast' forces the ~seconds Relay route.",
      +  "enum": [
      +    "best_price",
      +    "fast"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / test
      Added value: +{
      +  "description": "Test mode: true = no real money. You get a fake deposit address that completes by itself in ~15s, so you can test status, invoices, receipts and webhooks for free.",
      +  "type": "boolean"
      +}
  2. First observed

TDQS

A3.8/5.0
Behavior5/5

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

Annotations only state that this is a non-read-only, open-world, non-idempotent, non-destructive call. The description adds genuinely useful behavior the agent could not infer: one-time deposit address, funding completes in under a minute, non-custodial with no API key or wallet connection, automatic refund on failure, and a ready-to-sign `deposit_tx` for EVM sources.

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?

Roughly four short sentences, front-loaded with the core action (lock quote, get deposit address) followed by funding instructions and trust/timing facts. No filler, and each clause carries operational value.

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 12-parameter, money-moving tool with no output schema, the description covers the two-phase deposit flow, timing, refund safety, and EVM transaction delivery. It still leaves the agent guessing about the response shape beyond `deposit_tx` and about how to follow up (e.g., polling status), which matters here because no output schema exists.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline would be 3, but the description actively introduces a parameter name that does not exist — 'Send exactly `send_exactly` of the source token' — while the schema's actual field is `amount`. It also references `recipient` and `deposit_tx` (a response field), so the only parameter-level contribution is a naming inconsistency rather than added meaning.

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 description names a concrete verb and resource — lock a quote, receive a one-time deposit address, have output land at `recipient` — which lets an agent distinguish this execution tool from quote/status siblings like get_quote or get_swap_status. It stops short of explicitly naming an alternative or stating the boundary, so it is clear but not sibling-differentiating.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: the agent can infer this is the step after quoting because it produces a deposit address to fund. There is no explicit 'use this when…', no 'use compare_quotes/get_quote first', and no guidance on the test-mode or speed options as decision points, leaving the agent to infer the workflow.

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.