Skip to main content
Glama

Build swap transaction (Base)

build_swap_transaction

Returns an UNSIGNED Base transaction (and an ERC-20 approval transaction if needed) that performs the swap with the 1% CoinFactory fee embedded. The taker wallet must sign and broadcast it; CoinFactory never submits transactions. Swaps INTO critical-risk tokens are refused; high-risk tokens require acknowledgeRisk: true after relaying the risk signals to the user. Per-trade cap during beta: $1000. Non-custodial: CoinFactory returns aggregator calldata only and never holds funds or keys; the taker wallet signs and broadcasts. A 1% CoinFactory fee plus aggregator fees and gas apply and are shown in the quote. Trades are irreversible. This is not financial advice.

Input Schema

NameRequiredDescriptionDefault
takerYesThe wallet address that will sign — must hold the sellToken
buyTokenYes
sellTokenYes'ETH', a Base contract address, a symbol, or a CoinGecko id
sellAmountYesAmount of sellToken in human units, e.g. '0.5'
slippageBpsNoMax slippage in bps (default 100, max 500)
acknowledgeRiskNoRequired true when the buy token is rated high risk

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior5/5

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

Beyond the annotations it discloses the non-custodial model (aggregator calldata only, no funds or keys held), the exact fee stack (1% CoinFactory + aggregator fees + gas), a $1000 per-trade beta cap, risk-based refusals, and irreversibility. These are the operational facts an agent needs before invoking a write-path builder.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core facts are front-loaded, but the non-custodial promise and 'the taker wallet signs and broadcasts' are each stated twice, and 'This is not financial advice' adds little for an agent. About a quarter of the text is repetition.

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?

With no output schema, the description correctly describes the return value (unsigned tx plus optional approval tx). It covers fees, caps, risk gating and custody. It omits what to do after building (submitting/broadcasting, checking via get_swap_status) and any expiry of the unsigned payload.

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 83%, so the baseline is 3, but the description adds real meaning for acknowledgeRisk (required only for high-risk buy tokens, gated on relaying risk signals to the user) and indirectly bounds sellAmount via the $1000 cap. slippageBps is left entirely to the schema, so it is not a full 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?

States a specific verb and resource ('Returns an UNSIGNED Base transaction ... that performs the swap') and immediately scopes it with the embedded 1% fee and optional ERC-20 approval. The 'swap' framing is clearly distinguishable from the sibling builders (claim rewards, token launch, launch trade).

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?

It gives conditional rules (swaps into critical-risk tokens refused, high-risk tokens need acknowledgeRisk: true after relaying risk signals, $1000 beta cap) and states the taker must sign and broadcast. But it never says when to call this versus get_swap_quote first or how this relates to get_swap_status/get_risk_signals as prerequisites, so the workflow is only implied.

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