Skip to main content
Glama

Quote swap

quote_swap
Read-onlyIdempotent

Use for a DEX swap quote with a ready unsigned transaction: best route from Velora (ParaSwap), KyberSwap as fallback, on Base, Arbitrum, Ethereum, Optimism, Polygon, BNB Chain. Returns the paid x402 request for your input (GET /quote/swap, $0.002 per call; schema linked). Call that URL with an x402 or MPP client to get the data. Bad input is refused before any charge. Quote only: nothing is signed or sent, and the reply discloses P0's integrator fee. To check balances first use wallet_balance. First call each day returns the data itself, free; later calls return the paid request.

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": {
      "chain": "<chain>",
      "from": "<from>",
      "to": "<to>",
      "amount": "<amount>",
      "taker": "<taker>"
    },
    "name": "quote_swap"
  }
}

Input Schema

NameRequiredDescriptionDefault
toYestoken to buy: symbol or 0x address
fromYestoken to sell: symbol (USDC, WETH, ETH...) or 0x address
chainYesbase, arbitrum, ethereum, optimism, polygon or bsc (or chain id)
takerYesWallet that will sign and send; the returned calldata and approval are built for it
amountYesInteger string, amount to sell in base units (10 USDC = 10000000)
to_decimalsNoDecimals of the buy token; needed only when it is an address P0 does not know
slippage_bpsNomax slippage in basis points (50 = 0.5%). The alias 'slippage' is read as basis points too (Velora's unit); a 'slippage' below 10 is refused as ambiguous
from_decimalsNoDecimals of the sell token; needed only when it is an address P0 does not know

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / properties / amount / description
      Previous value: -"amount to sell in base units (10 USDC = 10000000)"New value: +"Integer string, amount to sell in base units (10 USDC = 10000000)"
    • changedInput schema / properties / from_decimals / description
      Previous value: -"only for tokens P0 does not know"New value: +"Decimals of the sell token; needed only when it is an address P0 does not know"
    • changedInput schema / properties / taker / description
      Previous value: -"wallet that will sign and send the swap"New value: +"Wallet that will sign and send; the returned calldata and approval are built for it"
    • changedInput schema / properties / to_decimals / description
      Previous value: -"only for tokens P0 does not know"New value: +"Decimals of the buy token; needed only when it is an address P0 does not know"
  2. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Well beyond the annotations, it discloses the payment mechanics ($0.002 per call over x402/MPP, first call each day free, later calls return the paid request rather than data), the validation guarantee ('bad input is refused before any charge'), and the integrator-fee disclosure in the reply. These are exactly the operational facts an agent cannot infer from readOnlyHint/idempotentHint.

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?

Purpose is front-loaded in the first clause and every subsequent sentence carries distinct information (sources, chains, price, payment flow, safety guarantee, free-first-call rule). It is somewhat dense with semicolons and parenthetical asides, which slightly hurts scannability, but nothing is padding.

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 an eight-parameter, no-output-schema tool, the description covers cost, response shape in both free and paid modes, validation behavior, and the unsigned nature of the result. The only omission is any hint about quote expiry or refresh, which would matter for time-sensitive calldata.

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% and all eight parameters, including the slippage alias and the conditional decimals fields, are already documented in the schema. The description adds no parameter-level meaning beyond what the structured fields provide, 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?

The opening clause names a specific verb and resource ('DEX swap quote with a ready unsigned transaction') and then narrows scope by naming the routing backends (Velora/ParaSwap with KyberSwap fallback) and the six supported chains. It is immediately distinguishable from the sibling read tools, which return chain or wallet state rather than swap calldata.

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 states the positive case ('Use for a DEX swap quote'), an explicit prerequisite alternative ('To check balances first use wallet_balance'), and a hard boundary ('Quote only: nothing is signed or sent'), so the agent knows this tool never executes a swap. The only minor gap is that no sibling for execution is named, but none appears in the provided catalog.

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