Skip to main content
Glama

Create a swap (deposit address)

create_swap
Idempotent

Create a swap from a quoteToken returned by get_quote. Returns a one-time depositAddress, the exact amount to send, expiresAt and a swapId for tracking. Only call after the user confirmed the route and both addresses. The swap only happens when the user sends the funds. Repeating the call with the same quoteToken and addresses returns the same deposit address.

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": {
      "quoteToken": "<quoteToken>",
      "destinationAddress": "<destinationAddress>",
      "refundAddress": "<refundAddress>"
    },
    "name": "create_swap"
  }
}

Input Schema

NameRequiredDescriptionDefault
quoteTokenYesquoteToken of the chosen route (valid for about 2 minutes).
refundAddressYesAddress on the sell asset's network that receives a refund if the swap cannot complete.
destinationAddressYesAddress that receives the bought asset, on the buy asset's network.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Adds substantial behavioral context beyond annotations: the one-time depositAddress, exact amount, expiry, swapId, and the fact that the swap only happens when the user sends funds. The idempotency note reinforces the annotation with a concrete guarantee for repeated calls using the same quoteToken and addresses.

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?

Four tight sentences, front-loaded with the core action and return values, then preconditions and lifecycle behavior. Every sentence carries operational value with no repetition.

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?

No output schema exists, but the description covers the important return fields and the user-funding lifecycle. Combined with full schema coverage and the preconditions, an agent has enough information to invoke this tool correctly.

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 baseline is 3. The description adds useful source context for quoteToken from get_quote and confirms both addresses must be user-confirmed, but it does not deepen the meanings of destinationAddress or refundAddress beyond the schema.

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 a swap from a quoteToken returned by get_quote. It also names the key return values and distinguishes the tool from get_quote by making clear this is the execution step after quoting.

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 says when to call: only after the user confirmed the route and both addresses. It also explains the repeat-call behavior and clarifies that no swap occurs until funds are sent, which is essential usage context.

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