Skip to main content
Glama

Build swap: approve + swap txs, simulated

blazar_build_swap
Read-only

One call to get everything needed to swap through BlazarFeeRouter: ordered txs[] (exact approve if needed, then swap), a plain-English summary per tx, an eth_call simulation of the swap (as if the approve were mined), the quote used, guards (minAmountOut, 3-minute deadline) and warnings[]. Use this instead of blazar_quote + blazar_decode_tx + blazar_simulate_tx. Only swaps built here (through BlazarFeeRouter) earn BZB trading rewards. Returns UNSIGNED txs; nothing is sent.

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>",
      "from": "<from>"
    },
    "name": "blazar_build_swap"
  }
}

Input Schema

NameRequiredDescriptionDefault
fromYesAddress that will sign and send the txs. Required: used for allowance checks, simulation and nonce.
amountYesAmount of tokenIn in HUMAN units, not wei: "1.5" = 1.5 POL, "250" = 250 BZB. Set amountIsBaseUnits=true to pass wei/base units instead.
tokenInYesToken to sell: symbol (POL, WPOL, BZB, USDC, USDT, WETH, WBTC) or its listed 0x address (see blazar_tokens). "POL" is the native gas token; WPOL is the ERC-20.
tokenOutYesToken to buy: symbol (POL, WPOL, BZB, USDC, USDT, WETH, WBTC) or its listed 0x address. Choose "POL" to receive native POL (auto-unwrapped).
recipientNoWho receives the output. Defaults to `from`.
slippageBpsNoMax slippage in basis points (50 = 0.5%). Default 50, max 300.
deadlineSecondsNoSeconds until the swap expires. Default 150; the fee router caps it at 180.
amountIsBaseUnitsNoIf true, amount is in base units (wei for 18-decimal tokens; 6 decimals for USDC). Default false.
maxPriceImpactBpsNoRefuse with INSUFFICIENT_LIQUIDITY above this impact. Default 3000 (30%).

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 readOnly/destructive annotations, it discloses the return composition (unsigned approve+swap txs, summaries, quote, warnings[]) and, critically, that the simulation is an eth_call run 'as if the approve were mined' and that 'nothing is sent' — which is what reconciles the readOnlyHint with a transaction-building tool. Guard behavior (minAmountOut, a deadline, warnings) is also surfaced, which the annotations 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 core promise, then a dense but purposeful enumeration of outputs, alternatives, and the reward caveat. Every clause carries information, though the single long list sentence is slightly heavy to scan compared with splitting the return contents from the routing advice.

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 nine parameters, no output schema, and a silent-write risk, the description carries its share: it describes the response shape, the simulation semantics, the safety guards, the unsigned nature of the output, and the incentive to prefer this route. Nothing an agent needs before calling is left to inference.

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 description coverage is 100%, so all nine parameters are already documented, and the description adds little parameter-level detail. Its only real addition is the mention of a minAmountOut guard, which hints at how slippageBps/maxPriceImpactBps are applied, so the baseline 3 applies.

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 ('One call to get everything needed to swap through BlazarFeeRouter') and enumerates exactly what comes back: ordered txs[], per-tx summaries, an eth_call simulation, the quote, guards and warnings[]. It also distinguishes itself from three named siblings, so an agent can pick it without opening any 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?

Gives an explicit replacement rule ('Use this instead of blazar_quote + blazar_decode_tx + blazar_simulate_tx') and an additional selection incentive ('Only swaps built here ... earn BZB trading rewards'). The only thing missing is an explicit when-not case, but the stated alternatives cover the realistic choice set.

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