Skip to main content
Glama

Quote a swap

trnch_quote
Read-onlyIdempotent

Free, no key, no wallet: quote any pair across eight routers (KyberSwap, LI.FI, Uniswap, 0x, SushiSwap, 1inch, Velora, Nordstern) without building a transaction. Returns the best amount out, already net of the Trnch fee, the router and the fee rate in basis points (feeBps). Covers the official Stock Tokens of Robinhood Chain too. 409 if a token is not tradable through Trnch. A transaction (trnch_buy, trnch_sell) needs an API key. A partner's integrator fee (integratorFeeBps, or the partner's default fee when the request carries X-Trnch-Partner-Key) is added to the Trnch fee and taken by the same router fee on every router; a router whose maximum fee is below the total is left out of the quote. The integrator fee is paid to the partner through the Trnch partner program after the swap is confirmed on chain. fees in the response: { side, token, trnch { bps, amount }, integrator { bps, amount, partner } or null, minAmountOut }, amounts in the smallest unit; minAmountOut is net of both fees and of slippage.

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": {
      "tokenIn": "<tokenIn>",
      "tokenOut": "<tokenOut>",
      "amountIn": "<amountIn>"
    },
    "name": "trnch_quote"
  }
}

Input Schema

NameRequiredDescriptionDefault
fastNoReturn the first clean quote after about 250 ms instead of waiting for the best price. May return a slightly worse price (partial: true when a slower router was cut). Default false.
tokenInYesToken sold: a 0x address or a Heat id.
amountInYesAmount of tokenIn in its smallest unit (wei-style integer string).
slippageNoLegacy: max slippage as a fraction (0.01 = 1%). Send slippageBps or slippage, not both.
tokenOutYesToken bought: a 0x address or a Heat id.
decimalsInNoDecimals of tokenIn. Default 18: set it for USDG (6) and other non-18 tokens.
decimalsOutNoDecimals of tokenOut. Default 18: set it for USDG (6) and other non-18 tokens.
slippageBpsNoMax slippage in basis points (100 = 1%). Default 100.
integratorFeeBpsNoIntegrator fee in basis points, 0 to 100, for a partner identified by X-Trnch-Partner-Key or by the partner ref of the API key. Overrides the partner's default fee; the default fee applies only with X-Trnch-Partner-Key, never through the partner ref of the API key alone. Without a partner, a value above 0 is refused.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / slippage / description
      Previous value: -"Max slippage as a fraction (0.01 = 1%). Default 0.01."New value: +"Legacy: max slippage as a fraction (0.01 = 1%). Send slippageBps or slippage, not both."
    • addedInput schema / properties / slippageBps
      Added value: +{
      +  "description": "Max slippage in basis points (100 = 1%). Default 100.",
      +  "maximum": 5000,
      +  "minimum": 10,
      +  "type": "integer"
      +}
  2. Changed2 schema fields changed
    • changedInput schema / properties / integratorFeeBps / description
      Previous value: -"Optional integrator fee in basis points, 0 to 100. Added to the Trnch fee and paid by the router to integratorRecipient in the same transaction. Default 0."New value: +"Integrator fee in basis points, 0 to 100, for a partner identified by X-Trnch-Partner-Key or by the partner ref of the API key. Overrides the partner's default fee; the default fee applies only with X-Trnch-Partner-Key, never through the partner ref of the API key alone. Without a partner, a value above 0 is refused."
    • removedInput schema / properties / integratorRecipient
      Removed value: -{
      -  "description": "EVM address that receives the integrator fee. Required when integratorFeeBps is above 0; the zero address is refused.",
      -  "pattern": "^0x[0-9a-fA-F]{40}$",
      -  "type": "string"
      -}
  3. Changed2 schema fields changed
    • addedInput schema / properties / integratorFeeBps
      Added value: +{
      +  "description": "Optional integrator fee in basis points, 0 to 100. Added to the Trnch fee and paid by the router to integratorRecipient in the same transaction. Default 0.",
      +  "maximum": 100,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / integratorRecipient
      Added value: +{
      +  "description": "EVM address that receives the integrator fee. Required when integratorFeeBps is above 0; the zero address is refused.",
      +  "pattern": "^0x[0-9a-fA-F]{40}$",
      +  "type": "string"
      +}
  4. Changed1 schema field changed
    • addedInput schema / properties / fast
      Added value: +{
      +  "description": "Return the first clean quote after about 250 ms instead of waiting for the best price. May return a slightly worse price (partial: true when a slower router was cut). Default false.",
      +  "type": "boolean"
      +}
  5. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already declare read-only/idempotent/non-destructive, and the description adds substantial behavior beyond them: fee accounting (Trnch fee plus integrator fee taken by the router), the rule that routers whose max fee falls below the total are excluded, the partner-key fee override semantics, and the shape of the fee block including minAmountOut being net of both fees and slippage. The 409 failure mode is disclosed.

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?

Front-loads the value proposition and the not-building-a-transaction distinction, then descends into fee mechanics. It is dense and slightly run-on (parenthetical router list, multiple fee clauses), but nearly every clause carries an operational fact an agent needs.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description correctly compensates by describing the fees object and minAmountOut. Nine parameters are all schema-documented, and the error case is covered. Minor gaps: the top-level amount-out field is only implied rather than named, and nothing is said about caching/staleness of quotes.

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 each parameter, but the description adds real meaning about integratorFeeBps: how it stacks on the Trnch fee, that it overrides a partner default only under X-Trnch-Partner-Key, and that a non-zero value is refused without a partner. That fee-interaction context is not derivable from the field description alone.

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?

States a specific verb (quote) and resource (any pair across eight named routers) and draws an explicit boundary against the sibling transaction tools trnch_buy and trnch_sell, which need an API key. An agent can tell this is a read-only price lookup without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Makes clear this is the no-key, no-transaction path and that actual swaps go through trnch_buy/trnch_sell. Also names the 409 condition for non-tradable tokens. It stops short of an explicit 'use this before trading' prescription or covering what to do on a 409 (fall back, retry, surface to user).

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