Skip to main content
Glama

swap build

swap_build
Read-only

Get a ready-to-sign swap transaction at the best DEX route: to, data, value and gas for your wallet, the minimum output after slippage, and the exact-amount approve() to send first for tokens. Unsigned: you sign and send it yourself; we never hold funds. Costs $0.005 USDC per call (x402).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainNobase (default), ethereum, arbitrum, optimism, polygon
amountYes
senderYesWallet that will sign
to_tokenYes
recipientNo
from_tokenYes
slippage_percentNoDefault 0.5

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.7/5.0
Behavior4/5

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

Adds real behavior beyond the annotations: the transaction is unsigned, the service is non-custodial ('we never hold funds'), and each call costs $0.005 USDC via x402. The per-call payment requirement is a critical operational fact that neither annotations nor schema convey. It stops short of covering failure modes, expiry of the quote, or route degradation.

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?

Three front-loaded sentences: action, trust model, cost. The middle sentence is dense with return-field names but each element is informative. No filler, though the output enumeration could be trimmed since it repeats what the tool's payload naturally contains.

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 7-parameter, no-output-schema tool, the description usefully describes the returned payload and the payment model, which is what an agent most needs. Gaps remain around parameter formats and quote validity, but the core call contract is clear.

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 43%, so four parameters (from_token, to_token, amount, recipient) are undocumented in both schema and description. The description touches slippage via 'minimum output after slippage' and references tokens, but never clarifies amount units/decimals, whether tokens are addresses or symbols, or the recipient default. Partial compensation only.

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?

States a specific verb+resource (build a swap transaction) and enumerates the exact payload it returns (to, data, value, gas, min output, approve call). It does not name or distinguish itself from the sibling swap_quote, which is the obvious adjacent tool an agent would confuse it with.

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 implied by 'ready-to-sign ... you sign and send it yourself', so an agent can infer this is the execution path rather than a price check. However, it never explicitly says when to prefer this over swap_quote, nor does it state prerequisites (funded wallet, prior approval) or exclusions.

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