Skip to main content
Glama

Quote a cross-chain swap

get_quote
Read-only

Compares 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

NameRequiredDescriptionDefault
amountYesAmount 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_assetYesDestination (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_assetYesSource (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

NameRequiredDescriptionDefault
toYesA routable asset.
bestYesOne quoted route.
fromYesA routable asset.
amount_inYesInput amount in normal units, as understood.
next_stepNoWhat to do next.
alternativesYesOther routes that answered, best output first.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

Goes well beyond the readOnly/openWorld annotations: no addresses required, flat 0.15% Shieldz fee already reflected in amount_out, quote staleness behaviour, and a concrete rate limit (about 20 in a burst, then one every 2 seconds). The only minor gap is that error retry guidance beyond "errors explain unsupported pairs or min/max" is thin.

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, return shape, workflow position, parameter meaning, staleness, fees and rate limits all arrive front-loaded and in a useful order. It is dense and long, with some overlap between the description's asset-id guidance and the schema text, but no sentence is filler.

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?

Given a read-only quote tool with a full output schema, the description covers everything an agent needs to call it correctly: address-free operation, unit expectations, cheap error paths, freshness constraints and rate limits. Return-value detail is rightly left to the output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 100%, so the baseline is 3; the description still adds real meaning by framing from_asset as what the user sends and to_asset as what they receive, noting they may be on different chains, and stressing that amount is in from_asset units and never in to_asset or USD. The ambiguity-resolution hint for shorthands duplicates the schema rather than extending it.

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?

Opens with a specific verb and resource ("Get live prices for swapping one asset into another, across chains") and names the six venues raced, so an agent knows exactly what it produces. It also distinguishes itself from create_swap by stating it creates nothing, and the sibling differentiation is explicit rather than inferred.

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?

States the target use case ("answer 'how much X do I get for Y'") and its position in the workflow ("show the user the numbers before create_swap"). It also routes the agent to list_assets for id discovery and tells it not to reuse stale quotes because create_swap re-quotes, which are genuine when/when-not instructions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.