Skip to main content
Glama

Sell a token

trnch_sell

Build a sell for USDC in one call: give token, and percent of the wallet balance (read on chain) or an exact amount. Quotes five routers and returns the best route as a transaction to sign. The Trnch fee is already deducted from the quote; the rate applied is returned as feeBps. Returns { router, feeBps, quote, approval, tx, chainId, from }: approval, when not null, has to be sent before tx, from the same wallet (chainId 99901). Nothing is sent by Trnch. Errors: 503 while the fee recipient is not configured on this chain (nothing is built), 404 no route, 429 rate or build limit (retry-after). 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. Requires an API key (created by wallet signature), sent as Authorization: Bearer .

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": {
      "token": "<token>"
    },
    "name": "trnch_sell"
  }
}

Input Schema

NameRequiredDescriptionDefault
tokenYesToken to sell, as an address.
amountNoExact amount in token units, e.g. 1234.5. Capped at the balance. Use this or percent.
percentNoShare of the wallet balance to sell, 100 = all. Use this or amount.
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 / 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"
      -}
  2. 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"
      +}
  3. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare the mutating-but-not-destructive, non-idempotent, open-world profile, and the description adds substantial context on top: the fee is pre-deducted and reported as feeBps, approval must be sent before tx from the same wallet on chainId 99901, nothing is broadcast by Trnch, and 503/404/429 have distinct meanings with retry-after. Minor gap: it does not say whether repeated calls produce different quotes or how long a quote stays valid, which matters for a non-idempotent build operation.

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 core purpose and inputs are front-loaded in the first sentence, and the response shape, error codes, fee mechanics, and auth follow in a logical order. It is dense and several clauses are packed into single long sentences, but nearly every sentence carries operational information, so little is genuinely wasted.

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?

With no output schema, the description carries the full burden of describing returns and does so explicitly, enumerating the response fields and the nested fees object including minAmountOut semantics. Auth requirements, error taxonomy, and the approval-before-tx ordering constraint are all present, leaving nothing an agent needs in order to call this correctly.

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 baseline is 3, but the description adds real meaning beyond it: percent is read from the on-chain wallet balance, amount is capped at the balance, integratorFeeBps interacts with the X-Trnch-Partner-Key header versus the API key's partner ref, and minAmountOut is net of both fees and slippage. The slippageBps default is corroborated rather than newly explained, so it is not a full 5.

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 description opens with a specific verb and resource — 'Build a sell for USDC in one call' — and immediately explains the inputs (token plus percent or exact amount) and the output (best route among five routers as a signable transaction). The sell-vs-buy distinction from trnch_buy is unambiguous, and the 'Nothing is sent by Trnch' clause clarifies that this constructs rather than executes.

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

Usage Guidelines3/5

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

Usage modes are clear (percent of on-chain balance or an exact amount, with the two being mutually exclusive), and error conditions 503/404/429 tell the agent what to do on failure. However, the description never explicitly routes the agent between this tool and siblings like trnch_quote (preview only) or trnch_confirm (execution), so the when-not guidance is left implicit.

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