Skip to main content
Glama

Unsigned swap transaction (nothing is signed or sent)

build_swap_transaction
Read-onlyIdempotent

Build an unsigned Cardano swap transaction for a wallet that signs for itself, through the DexHunter aggregator. Returns the transaction as CBOR hex with its hash, what it does (network fee, validity, every output with address, ADA and tokens, and which outputs return to the wallet), the expected and the minimum amount received, the fees (DEX batcher, aggregator and partner fee, network fee, all in ADA), what the trade costs worked out from the transaction itself next to what the aggregator states (cost, with a warning when the transaction takes more), and the steps to sign and submit it. Fees are fixed ADA amounts, so a small trade can cost a large share of itself. Realtap never signs, holds keys or submits: nothing happens until the owner of address signs the transaction and sends it. Call it only when that owner asked for this trade, and check the token with get_token first (liquidity, safety). Limited to a few calls per minute.

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

Input Schema

NameRequiredDescriptionDefault
amountYesAmount of tokenIn to sell, decimal-adjusted (100 = 100 ADA when tokenIn is ADA).
addressYesMainnet payment address (addr1…) of the wallet that will sign: its UTxOs are spent and it receives the result.
tokenInYesWhat is sold: a token unit, or "lovelace" / "ADA" for ADA.
tokenOutYesWhat is bought: a token unit, or "lovelace" / "ADA" for ADA.
slippagePctNoHow far the price may move against the trade before the order must not execute, in percent (1 = 1 %).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior5/5

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

Beyond the annotations, the description discloses the exact return payload (CBOR hex, hash, fee breakdown, cost-vs-aggregator comparison with a warning, sign-and-submit steps), the custody boundary ('Realtap never signs, holds keys or submits'), the fixed-fee caveat for small trades, and a rate limit ('a few calls per minute'). These are behaviors structured fields cannot convey.

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?

Front-loaded with the action and the return shape, and every clause carries information (fees, warnings, prerequisites, rate limit). The return-value enumeration is a single very long sentence that could be split, but no content is padding.

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?

With no output schema, the description carries the full burden of describing returns, and it does so exhaustively: CBOR hash, outputs and which return to the wallet, expected vs minimum received, fee components, cost warnings, and submission steps. For a five-parameter transaction-building tool, nothing an agent needs 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 coverage is 100%, so all five parameters including slippagePct are already documented, and the description adds little per-parameter detail. It does tie `address` to ownership ('the owner of `address` signs') and mentions the minimum amount received, which relates to slippage, but does not explain the parameter itself. Baseline 3 is appropriate.

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?

A specific verb and resource: 'Build an unsigned Cardano swap transaction ... through the DexHunter aggregator', with the title reinforcing that nothing is signed or sent. It is clearly distinct from read-only siblings like get_swap_quote by the word 'build', but it never names plan_swap or get_swap_quote to route the agent explicitly.

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?

'Call it only when that owner asked for this trade, and check the token with get_token first (liquidity, safety)' gives a clear precondition and an explicit prerequisite call. It stops short of naming the alternative preview tools (plan_swap, get_swap_quote) that an agent would want to compare against.

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