Quote a cross-chain swap
get_quoteCompares live cross-chain swap prices before you swap, returning competing routes, output after fees, guaranteed minimum and ETA so you can show users how much they get.
Instructions
Get live prices for swapping one asset into another, across chains, by racing NEAR Intents, Chainflip, Relay, MAYAChain, BOB Gateway and Garden. Returns the best route and the alternatives, with output after fees, guaranteed minimum, all-in cost % and ETA. Use it to answer "how much X do I get for Y" and to show the user the numbers before create_swap. It creates nothing and needs no addresses. from_asset is what the user sends and to_asset what they receive; they may sit on different chains. Give each as an exact asset id or CHAIN.SYMBOL; when a shorthand is ambiguous (bridged USDC, for example) the error lists the matching ids, and list_assets finds ids by name or chain. amount is how much from_asset the user sends, in from_asset's own units, never in to_asset or USD. Quotes move with the market, so do not reuse one after a few minutes; create_swap re-quotes on its own. Shieldz charges a flat 0.15% (already in amount_out). Errors explain unsupported pairs or minimum and maximum amounts. Rate-limited per caller (roughly 20 quotes in a burst, then one every 2 seconds).
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": {
"from_asset": "<from_asset>",
"to_asset": "<to_asset>",
"amount": "<amount>"
},
"name": "get_quote"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | Amount of from_asset in normal decimal units as a string ("100", "0.05"), NOT base units or wei. Digits and one optional dot only; no commas, signs or exponents. | |
| to_asset | Yes | Destination (what the user receives). asset. Either an exact asset_id from list_assets ("BASE.USDC-0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913") or CHAIN.SYMBOL shorthand ("ZEC.ZEC", "BTC.BTC", "ETH.ETH", "SOL.SOL", "BASE.USDC"). Shorthand resolves to the verified asset; if it is ambiguous the error lists the exact ids to use. | |
| from_asset | Yes | Source (what the user sends). asset. Either an exact asset_id from list_assets ("BASE.USDC-0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913") or CHAIN.SYMBOL shorthand ("ZEC.ZEC", "BTC.BTC", "ETH.ETH", "SOL.SOL", "BASE.USDC"). Shorthand resolves to the verified asset; if it is ambiguous the error lists the exact ids to use. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | A routable asset. | |
| best | Yes | One quoted route. | |
| from | Yes | A routable asset. | |
| amount_in | Yes | Input amount in normal units, as understood. | |
| next_step | No | What to do next. | |
| alternatives | Yes | Other routes that answered, best output first. |