Skip to main content
Glama

Blazar Polygon plugin

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. Polygon only (chain 137).

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%).

Output Schema

NameRequiredDescriptionDefault
txsYesSign and send in order.
fromNo
nextNo
batchNoEIP-5792 wallet_sendCalls request with the same calls (smart wallets).
quoteNo
actionYes
guardsNo
safetyNo
chainIdNo137 Polygon, 8453 Base, 1 Ethereum. BlazarForce builds are always 137.
detailsNo
signingNo
summaryYes
warningsYes
routeGuideNo
simulationYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

With readOnlyHint=true and destructiveHint=false already declared, the description explains WHY this write-shaped tool is read-only: 'Returns UNSIGNED txs; nothing is sent.' It further discloses that the simulation assumes the approve were mined, that guards (minAmountOut, deadline) are baked in, that warnings[] may be returned, and the chain constraint — real behavioral context beyond the annotations.

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

Conciseness5/5

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

Front-loaded with the core promise ('One call to get everything needed to swap') followed by the return inventory, then the sibling routing, the reward rationale, and the safety/scope caveats. Every clause carries distinct information; no filler or repeated annotation content.

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?

For a 9-parameter build tool with an output schema, the description covers the pieces an agent cannot get from structured fields: that txs are unsigned, the ordering of approve-then-swap, the simulated-approve assumption, guards applied, warnings possible, and chain restriction. Nothing needed for correct invocation 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 nine parameters including amount units, slippageBps, deadlineSeconds and maxPriceImpactBps are already documented in the schema. The description's mention of 'minAmountOut' and a '3-minute deadline' restates guard behavior the schema already carries (deadline max 180), so it adds little beyond the structured fields. Baseline 3 is appropriate.

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?

The description states a specific verb and resource — building swap txs through BlazarFeeRouter — and enumerates exactly what the single call returns: ordered txs[] (approve then swap), per-tx summaries, an eth_call simulation, the quote, guards, and warnings[]. It distinguishes itself from quote/decode/simulate siblings by name rather than leaving the agent to guess.

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 explicitly routes the agent: 'Use this instead of blazar_quote + blazar_decode_tx + blazar_simulate_tx,' and adds a positive selection reason ('Only swaps built here ... earn BZB trading rewards') plus a hard scope limit ('Polygon only, chain 137'). An agent knows both when to pick this and when it is out of scope.

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