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. 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).

Input Schema

TableJSON 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.8/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden and does so thoroughly: it discloses cost, x402 payment flow, quote TTL, stored quoteId behavior, safety verdicts, readiness checks, stale-quote behavior, and nuanced inconclusive/high-tax/launch-window handling. It also explains downstream tradeSwap refusals such as 422 exit_risk_high and 422 sell_unverified.

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?

The definition is front-loaded with purpose and is structurally organized into Inputs, Returns, Errors, and Next. It is necessarily long for a complex quoting tool, but there is some redundancy, notably the payment/cost explanation repeated at the top and bottom.

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 the lack of annotations and output schema, the description is unusually complete: it covers inputs, return shape, errors, quote lifecycle, readiness, safety checks, and agent routing decisions. An agent has enough information to call tradeQuote correctly and understand follow-up 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 documents all 14 parameters. The description adds useful semantic context beyond the schema, especially taker readiness, quote TTL/expiry, and exitRisk policy interaction with next, though it does not add meaning for every parameter.

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 states a specific verb and resource: pricing a swap between two tokens across indexed venues and storing it as a quoteId. It clearly differentiates the quote from tradeSwap and mentions tradeSearch/tradeVenues for resolving inputs.

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?

The description explicitly routes the agent: use tradeSwap when next is swap, stop when next is stop, requote when next is requote, and use tradeSearch or tradeVenues to fix bad inputs. It also explains when stop and requote conditions apply, including the two-quote rule for requote.

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