Skip to main content
Glama

Blazar Polygon plugin

Build any-token swap (Polygon, Base, Ethereum): approve + swap, simulated

blazar_build_any_swap
Read-only

One call to swap ANY non-BZB token pair on Polygon (default), Base or Ethereum (chain param) through the best of KyberSwap and LI.FI (Velora fallback; same-chain only, no bridges): token-safety check (refuses blocked tokens; unverified ones need allowUnverified=true), router allowlist, exact approve, slippage (max 300 bps) and deadline guards, USD-loss cap, recipient/value calldata checks, and an eth_call simulation of the swap before returning. Returns ordered UNSIGNED txs[] plus batch (EIP-5792). BZB/BBY pairs are refused with USE_BLAZAR_ROUTE: use blazar_build_swap (fee router, earns trading rewards). Not eligible for trading rewards.

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_any_swap"
  }
}

Input Schema

NameRequiredDescriptionDefault
fromYesAddress that will sign and send the txs. Required: used for allowance checks, simulation and nonce.
chainNoChain: "polygon" (default, chain 137), "base" (8453) or "ethereum" (1). BZB / BlazarSwap tools are Polygon only.
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: a symbol (USDC, WETH, AAVE, LINK...; resolved only via the chain's curated list or an exact unique KyberSwap-verified match) or any 0x token address on the chosen chain. Native coin: "POL" on Polygon, "ETH" on Base / Ethereum.
providerNoauto (default): KyberSwap and LI.FI compared, best output wins; Velora as fallback. Same-chain swaps only.
tokenOutYesToken to buy: a symbol (USDC, WETH, AAVE, LINK...; resolved only via the chain's curated list or an exact unique KyberSwap-verified match) or any 0x token address on the chosen chain. Native coin: "POL" on Polygon, "ETH" on Base / Ethereum.
recipientNoWho receives the output. Defaults to `from`.
slippageBpsNoMax slippage in bps (50 = 0.5%). Default 50, max 300.
allowUnverifiedNoAllow tokens whose safety verdict is caution (unverified, taxed, proxy). Blocked tokens are always refused. Default false.
deadlineSecondsNoSeconds until the swap expires. Default 150.
amountIsBaseUnitsNoIf true, amount is in base units (wei for 18-decimal tokens; 6 decimals for USDC). Default false.
maxPriceImpactBpsNoRefuse when the output is worth more than this many bps less than the input in USD. Default 500 (5%).

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.6/5.0
Behavior5/5

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

Annotations only say readOnly/openWorld/non-idempotent; the description adds substantial context beyond them — token-safety gating with allowUnverified, router allowlist, exact approve, slippage/deadline guards, USD-loss cap, calldata recipient/value checks, and an eth_call simulation before returning. It also clarifies the output is UNSIGNED txs plus an EIP-5792 batch, which explains why readOnlyHint=true despite building approve+swap calldata.

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 action and chain scope, then layers safety/guard details and the sibling exclusion. It is dense and parenthetical-heavy in one long sentence, but nearly every clause carries decision-relevant information.

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 12-parameter tool with an output schema, the description covers chain scope, routing, safety gating, guard conditions, sibling disambiguation, and the shape of the return (unsigned txs + batch). Nothing an agent needs to choose or invoke it correctly 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 parameters like slippageBps (max 300), deadlineSeconds, allowUnverified, chain default, and amount units are already documented in the schema. The description mostly restates those constraints rather than adding new meaning, though the cross-parameter safety gate (unverified tokens need allowUnverified=true) is a useful reinforcement.

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 — swaps ANY non-BZB token pair across Polygon/Base/Ethereum via KyberSwap/LI.FI with a Velora fallback — and explicitly carves out the sibling case (BZB/BBY pairs refused, use blazar_build_swap). An agent can distinguish it from blazar_build_swap without opening either 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?

Names both the when-to-use condition (any non-BZB pair, same-chain only, no bridges) and the when-not case with the exact alternative tool for BZB/BBY pairs. It also explains the fallback routing behavior (Velora) so the agent knows the provider selection is automatic.

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