get_quote
Best route and expected output for selling a specific amount of one token for another on one chain, priced from the pools LCX Liberty DEX indexes itself. Use it for what an amount would swap for; use get_price for a token's value, and search_tokens first to turn a ticker into an address. Read-only: it never executes a trade. Returns output.amount and output.minimumAmount (at 0.5% slippage) in tokenOut's base units, with output.decimals to scale them; priceImpactPct, gasFeeUSD, the venues and the per-hop routes; and blockNumber and expiresAt, since a quote is priced at one block and lives 120 seconds. Also returns swapUrl: a link that opens this same swap on the LCX Liberty DEX site, filled in and freshly quoted, for the user to review and sign with their own wallet. Give it to the user when they want to make the swap; opening it executes nothing. When there is no quote, the result is an error that says why: no route between the two tokens, or liquidity too thin for this size, usually naming a size that would fill.
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": {
"chainId": "<chainId>",
"tokenIn": "<tokenIn>",
"tokenOut": "<tokenOut>",
"amount": "<amount>"
},
"name": "get_quote"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | Positive human amount of tokenIn to sell, e.g. "1.5". Scaled by the token's own decimals, which the server knows: do not send decimals. | |
| chainId | Yes | 1 Ethereum, 8453 Base, 42161 Arbitrum One, 10 OP Mainnet, 4663 Robinhood Chain, 56 BNB Chain, 137 Polygon, 43114 Avalanche, 130 Unichain, 143 Monad, 5042 Arc, 999 HyperEVM, 9745 Plasma, 59144 Linea, 4326 MegaETH, 57073 Ink, 480 World Chain, 1868 Soneium, 100 Gnosis, 25 Cronos, 146 Sonic, 324 ZKsync | |
| tokenIn | Yes | Sell token address. Use the zero address for native ETH. | |
| decimals | No | Optional, and best left out. Only for a token the index holds no decimals for; a value that disagrees with the token's own is refused (decimals_mismatch). | |
| tokenOut | Yes | Buy token address. |