Skip to main content
Glama

HelmSwap

Build unsigned swap transaction (quoteResponse / userPublicKey)

build_swap_transaction
Read-onlyIdempotent

Same unsigned transaction as build_swap, for agents that already pass a quoteResponse and a userPublicKey (also accepted: walletAddress, taker, recipient). Use only after get_swap_quote (or get_quote), when the user wants the transaction and has given their own wallet address; read it back first. Pass the whole result of get_swap_quote as quoteResponse. If it has expired (about 15 seconds), get a fresh one. Returns swapTransaction (a base64 v0 transaction) and lastValidBlockHeight on Solana, or transaction and any approvals (sign those first) on EVM chains, plus the fields build_swap returns. Other common swap options (priority fee, wrap/unwrap, compute-unit settings) are accepted and ignored. The transaction is real and live. This server does not sign, execute or broadcast anything and never accepts a key: userPublicKey is an address only, and no API key is needed on Solana or EVM chains. If a build is refused or rate limited, give the user the openInHelmSwapUrl link from the quote instead. Not financial advice.

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": {
      "quoteResponse": "<quoteResponse>",
      "userPublicKey": "<userPublicKey>"
    },
    "name": "build_swap_transaction"
  }
}

Input Schema

NameRequiredDescriptionDefault
chainNoOptional. Taken from quoteResponse when omitted.
quoteResponseYesThe whole object returned by get_swap_quote. Must include quoteTicket.
userPublicKeyYesThe user's wallet address that will sign (Solana base58 or EVM 0x). Address only, never a private key. Alias: walletAddress, taker, recipient.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the annotations it discloses that nothing is signed, executed or broadcast, that no private key is ever accepted, that no API key is required on Solana or EVM, that quotes expire in roughly 15 seconds, and that priority-fee/wrap/compute-unit options are silently ignored. It also covers partial failure handling (on refusal or rate limit, hand the user the openInHelmSwapUrl link).

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?

The prerequisite and the core instruction come first, and most sentences carry distinct operational facts. It is dense and a bit long, with minor filler at the end ('The transaction is real and live', 'Not financial advice') that does not guide invocation.

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 describing the return shape for both Solana (swapTransaction base64 v0 plus lastValidBlockHeight) and EVM (transaction plus approvals to sign first). For a live-transaction builder with no output schema, an agent has everything needed to call it and to interpret 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, but the description adds real meaning: pass the entire get_swap_quote result rather than selected fields, the quote must still be fresh, the address must be one the user controls, and alternate parameter names are accepted. It slightly repeats schema text (the alias list appears in both), which keeps it off a 5.

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?

It names a specific verb and resource (build an unsigned swap transaction) and explicitly positions itself against sibling build_swap by stating it is the variant that takes a quoteResponse and userPublicKey. An agent can distinguish the two without opening a schema.

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?

It gives an explicit prerequisite (only after get_swap_quote or get_quote), a condition (user wants the transaction and has supplied their own wallet address), and a sequencing instruction (read the address back first). It also names the sibling alternatives get_swap_quote/get_quote and the fallback action when the quote expires.

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.