Skip to main content
Glama

Build an UNSIGNED swap transaction

build_swap_tx
Read-only

Builds an UNSIGNED MultiversX swap transaction for sender to sign with its own wallet. The transaction is verified and rebuilt from verified fields only (receiver = hard-coded OneDex aggregator, or the allowlisted XOXNO router after strict route decoding, capped gas, gasPrice 1e9). Returns the transaction, a human-readable summary, costs, warnings, expiresAt (advisory; minOut is the on-chain protection) and signingLink: a MultiversX Web Wallet URL (wallet.multiversx.com/hook/transaction) with this exact transaction pre-filled, for a human to open, check receiver/amount/token on the wallet screen and confirm there. This server never signs or holds keys.

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": {
      "tokenIn": "<tokenIn>",
      "tokenOut": "<tokenOut>",
      "amountIn": "<amountIn>",
      "sender": "<sender>"
    },
    "name": "build_swap_tx"
  }
}

Input Schema

NameRequiredDescriptionDefault
senderYesBech32 address (erd1…) of the wallet that will sign
networkNoMultiversX network (default mainnet; devnet only if configured)mainnet
tokenInYes"EGLD", a token identifier like "ONE-f9954f", or a unique ticker like "USDC"
amountInYesAmount of tokenIn as a decimal string, e.g. "1.5" (not base units)
tokenOutYes"EGLD", a token identifier like "ONE-f9954f", or a unique ticker like "USDC"
slippageBpsNoSlippage in basis points (100 = 1%, default). Above 500 needs confirmHighSlippage: true; above 2000 is refused.
confirmHighImpactNoMust be true to accept price impact above 10%, or when the aggregator-based and independent (api.multiversx.com) impacts disagree by more than 5 points
confirmHighSlippageNoMust be true to accept slippage above 5%

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the annotations it discloses substantial behavior: the transaction is rebuilt from verified fields only, receiver is a hard-coded OneDex aggregator or an allowlisted XOXNO router after strict route decoding, gas is capped, gasPrice is pinned to 1e9, and expiresAt is advisory while minOut is the real on-chain protection. It also states explicitly that the server never signs or holds keys, which is the key safety fact an agent needs.

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?

Content is front-loaded and nearly every clause carries information, with the unsigned/no-keys guarantee stated early. The final sentence is a dense run-on listing five return fields, which costs it a point on readability but not on substance.

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, and the description compensates by enumerating the return payload: transaction, human-readable summary, costs, warnings, expiresAt, and the signingLink wallet URL. For an 8-parameter transaction builder that hands off to a human signer, an agent has everything needed to call it and explain the result.

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 baseline is 3, and the description adds some meaning on top: it frames the output the parameters steer toward (capped gas, pinned gasPrice) and clarifies that minOut, not expiresAt, is the binding on-chain protection, which informs how slippageBps is interpreted. It stops short of explaining the slippage/impact confirmation flags in its own words, leaving that to 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?

Opens with a specific verb and resource: 'Builds an UNSIGNED MultiversX swap transaction for `sender` to sign'. The UNSIGNED qualifier and 'this server never signs or holds keys' sharply distinguish it from a signing or simulating tool, so an agent can tell what it produces without opening the schema.

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?

The description makes the usage context clear: it builds an unsigned transaction whose `signingLink` a human opens in the MultiversX Web Wallet to verify receiver/amount/token and confirm there. It does not explicitly name when to call simulate_swap_tx first or get_quote instead, so the routing to named siblings is left implicit rather than stated.

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