Skip to main content
Glama

tradeQuote

Prices a swap between two different tokens across the indexed venues and stores it under a quoteId.

  • Cost: 0.01 USDC per call, paid over x402.

  • Inputs: sell, buy and amount (required), and optional side, slippageBps, split and hop limits, venues, excludeVenues, taker and ttlSec. Name the wallet that will trade in taker to get readiness.

  • Returns: the best plan in best, with routes, safety, warnings and expiresAt. With taker, readiness says whether that wallet holds the input, which approval tradeSwap will need, whether it can pay gas and the swap fee, and the total cost to finish. The quoteId is good until expiresAt (ttlSec, at most 120 seconds). Check safety.verdict before you swap.

  • Errors:

    • 400 ticker_not_allowed: sell and buy are 0x addresses. Resolve a ticker with tradeSearch.

    • 400 unsupported_pair: sell and buy must be different assets.

    • 400 unknown_venue: use ids from tradeVenues.

    • 404 token_not_found: no ERC-20 token at that address.

    • 422 no_route, insufficient_liquidity, unsupported_venue or buy_reverts: no tradable route. Stop, or change the trade.

  • Next:

    • tradeSwap: turn the quoteId into unsigned transactions. Do it when next is swap. stop means the quote cannot be traded, and nextReason says why: best.executable is false, the verdict is cannot_sell, high_tax or illiquid, readiness.ready is false, the request asked exitRisk stop and the token you buy rated high (nextReason.code exit_risk_high; tradeSwap refuses it with 422), or the sell check was inconclusive because of the token or an unknown cause (nextReason.code sell_unverified; tradeSwap refuses it with 422, including for a sale into USDC). requote means the sell check was inconclusive because it did not finish (a provider error, the call budget, the simulation allowance): quote again shortly, and stop if the second quote also answers requote. While the server's simulation budget is paused, a quote whose sell check needs a simulation answers 503 rpc_unavailable instead, and nothing is charged; a retry within minutes meets the same pause. tradeSwap still accepts a requote quote: on a token output it re-checks the sell from the recipient wallet, serves the swap if that check passes, and answers 503 rpc_unavailable if the re-check does not finish; on a USDC or pinned output it serves the swap, because the swap's own simulation is the exit. An inconclusive quote is still charged. A sell tax above 1000 basis points (trade.quote.max_sell_tax_bps) is a high_tax verdict: the sell works, the tax is too high to trade (nextReason.code high_tax; tradeSwap refuses it with 422). A sell tax at or above 9000 basis points (trade.quote.honeypot_sell_tax_bps) is a cannot_sell verdict, a honeypot. A tax measured inside the launchpad's launch window reads high_tax with a launch_window warning instead, and the check after the window settles it. exitRisk on the response is the stored exit-risk rating of the token you buy, null when you buy USDC or the token has no rating yet. It is separate from the sell-check verdict: it says whether outside buyers got out, from the trading history. A high level adds an exit_risk_high warning. The request's exitRisk policy is warn by default and leaves next alone; stop answers next: stop on a high level, and only for the token you buy, so it never blocks selling a token to USDC.

Costs 10000 base units (0.01 USDC) per call. Or send an account's key in the ARCGATE-KEY header on the MCP connection to pay in units instead. Payment goes in params._meta["x402/payment"]; use an x402-aware MCP client (see https://docs.arcgate.dev/#arcgate/description/mcp-for-agents).

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": {
      "sell": "<sell>",
      "buy": "<buy>",
      "amount": "<amount>"
    },
    "name": "tradeQuote"
  }
}

Input Schema

NameRequiredDescriptionDefault
buyYesThe token to buy, as a 0x address. Native and ERC-20 USDC are the same asset. It must differ from `sell`; either side may be USDC.
sellYesThe token to sell, as a 0x address (a ticker is `ticker_not_allowed`: resolve it with tradeSearch). Native and ERC-20 USDC are the same asset. It must differ from `buy`.
sideNo`exactIn` spends exactly `amount` of `sell`. `exactOut` buys exactly `amount` of `buy`.exactIn
takerNoThe wallet that will trade, as a 0x address. Name it to get `readiness` back for that wallet.
amountYesA positive decimal string in the token's own units, e.g. "1.5" for 1.5 USDC, not base units. It is the `sell` amount for `exactIn` and the `buy` amount for `exactOut`.
ttlSecNoHow long the stored quote (and this response's expiresAt) stays live, in seconds (1-120, default 120). A caller may shorten it to re-quote sooner; it can never lengthen past 120s. Safe to shorten or leave at default: POST /trade/v1/swap always re-quotes and re-simulates at the current block and 409s quote_stale below the stored minAmountOut, so this bounds staleness risk, not price risk. The on-chain execution deadline is a separate parameter (deadlineSec, POST /trade/v1/swap).
venuesNoQuote only through these venue ids, from tradeVenues. Null allows every venue.
maxHopsNoThe most pools one path may cross (default 2).
sourcesNoWhere routes come from. The default `native` is arcgate's own indexed venues. Any other source needs `taker`.
exitRiskNoWhat a high exit risk on the token you buy does (default `warn`). `warn` adds an `exit_risk_high` warning and leaves `next` as it is. `stop` answers `next: stop` with `nextReason.code` `exit_risk_high`, and POST /trade/v1/swap refuses the quote with 422 `exit_risk_high`. Exit risk is not the sell-check verdict. Only the token you buy counts, so `stop` never blocks selling a token to USDC.warn
maxSplitsNoThe most paths one trade may be split across (default 3).
allowSplitsNoWhether the trade may be split across several paths.
slippageBpsNoHow far the result may miss the quote, in basis points (default 100). It sets `minAmountOut` for `exactIn` and `maxAmountIn` for `exactOut`.
excludeVenuesNoVenue ids, from tradeVenues, to leave out.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / exitRisk
      Added value: +{
      +  "default": "warn",
      +  "description": "What a high exit risk on the token you buy does (default `warn`). `warn` adds an `exit_risk_high` warning and leaves `next` as it is. `stop` answers `next: stop` with `nextReason.code` `exit_risk_high`, and POST /trade/v1/swap refuses the quote with 422 `exit_risk_high`. Exit risk is not the sell-check verdict. Only the token you buy counts, so `stop` never blocks selling a token to USDC.",
      +  "enum": [
      +    "warn",
      +    "stop"
      +  ],
      +  "type": "string"
      +}
  2. Changed12 schema fields changed
    • addedInput schema / properties / allowSplits / description
      Added value: +"Whether the trade may be split across several paths."
    • addedInput schema / properties / amount / description
      Added value: +"A positive decimal string in the token's own units, e.g. \"1.5\" for 1.5 USDC, not base units. It is the `sell` amount for `exactIn` and the `buy` amount for `exactOut`."
    • addedInput schema / properties / buy / description
      Added value: +"The token to buy, as a 0x address. Native and ERC-20 USDC are the same asset. It must differ from `sell`; either side may be USDC."
    • addedInput schema / properties / excludeVenues / description
      Added value: +"Venue ids, from tradeVenues, to leave out."
    • addedInput schema / properties / maxHops / description
      Added value: +"The most pools one path may cross (default 2)."
    • addedInput schema / properties / maxSplits / description
      Added value: +"The most paths one trade may be split across (default 3)."
    • addedInput schema / properties / sell / description
      Added value: +"The token to sell, as a 0x address (a ticker is `ticker_not_allowed`: resolve it with tradeSearch). Native and ERC-20 USDC are the same asset. It must differ from `buy`."
    • addedInput schema / properties / side / description
      Added value: +"`exactIn` spends exactly `amount` of `sell`. `exactOut` buys exactly `amount` of `buy`."
    • addedInput schema / properties / slippageBps / description
      Added value: +"How far the result may miss the quote, in basis points (default 100). It sets `minAmountOut` for `exactIn` and `maxAmountIn` for `exactOut`."
    • addedInput schema / properties / sources / description
      Added value: +"Where routes come from. The default `native` is arcgate's own indexed venues. Any other source needs `taker`."
    • addedInput schema / properties / taker / description
      Added value: +"The wallet that will trade, as a 0x address. Name it to get `readiness` back for that wallet."
    • addedInput schema / properties / venues / description
      Added value: +"Quote only through these venue ids, from tradeVenues. Null allows every venue."
  3. First observed

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations, the description carries the whole burden and does: pricing of 0.01 USDC per call over x402, the ARCGATE-KEY alternative, a hard 120s quote TTL, that inconclusive quotes are still charged, that 503 rpc_unavailable is not charged, and full 4xx/422 error semantics. It also discloses that tradeSwap re-quotes and 409s quote_stale below minAmountOut, which is non-obvious behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The bullet structure and front-loading of purpose and cost are good, but the requote/rpc_unavailable paragraph is a dense run-on that restates the same pause-and-retry behavior several times. exitRisk and ttlSec are explained in the parameter schema and then explained again at length in the prose, so the description is noticeably longer than the decision-relevant content requires.

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 14-parameter, paid, quoting tool with no output schema and no annotations, the description supplies everything an agent needs: payment mechanics, expiry, the shape of best/routes/safety/warnings, the readiness block, the next/nextReason decision tree, and the error taxonomy with recovery actions.

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 100%, so the schema already defines all 14 parameters; the description mostly repeats the required inputs and the max 120s TTL. It does add policy-level meaning the schema only partly conveys, notably what exitRisk warn vs stop does to next and nextReason, and why taker is what unlocks readiness. That is above the baseline 3 but not transformative.

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 sentence gives a specific verb, resource and outcome: prices a swap between two tokens across indexed venues and stores it under a quoteId. That distinguishes it cleanly from tradeSwap (which turns the quote into transactions) and tradeSearch (which resolves tickers).

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 explicitly routes the agent onward: use tradeSwap when next is swap, requote when the sell check did not finish, stop when nextReason explains a blocked trade, and use tradeSearch/tradeVenues to fix ticker and venue inputs. Stop conditions are enumerated with the exact codes that trigger them.

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