Skip to main content
Glama

Sell a token

trnch_sell

Build a sell for USDG in one call: give tokenId or token, and percent of the wallet balance (read on chain) or an exact amount. Quotes eight routers and returns the best route as a transaction to sign. The Trnch fee (0.25% standard, 0.10% between major assets, 0.05% between a Stock Token and a major asset, 0.50% for tokens under 24 h old or with no known launch time; the rate applied is returned as feeBps) is already deducted from the quote. Returns { router, feeBps, quote, approval, tx, chainId, from }: approval, when not null, has to be sent before tx, from the same wallet (chainId 4663). Nothing is sent by Trnch. Errors: 409 token not tradable through Trnch (kept out by Trnch), 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

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "trnch_sell"
  }
}

Input Schema

NameRequiredDescriptionDefault
tokenNoToken to sell, as an address. Use this or tokenId.
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.
tokenIdNoOpaque token id from the Heat feed (field id). Use this or token.
slippageBpsNoMax slippage in basis points (100 = 1%). Default 100, raised to a known token tax + 1% up to 15%; above that, required.
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. Changed1 schema field changed
    • changedInput schema / properties / slippageBps / description
      Previous value: -"Max slippage in basis points (100 = 1%). Default 100."New value: +"Max slippage in basis points (100 = 1%). Default 100, raised to a known token tax + 1% up to 15%; above that, required."
  4. Changed1 schema field changed
    • changedInput schema / properties / tokenId / description
      Previous value: -"Opaque token id from trnch_heat (field id). Use this or token."New value: +"Opaque token id from the Heat feed (field id). Use this or token."
  5. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the annotations (openWorldHint, non-idempotent, non-read-only), the description discloses a lot: the full fee schedule with the conditions that select each tier, that the fee is already deducted from the quote, that approval when non-null must be sent before tx from the same wallet and chain (4663), and the exact 409 and 429 error semantics with retry-after. The integrator fee interaction, including routers excluded when their max fee is below the total, is also disclosed.

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 content is dense but the form is a single run-on paragraph with deeply nested parentheses for the fee tiers, which makes the fee schedule hard to parse. Nearly every clause carries information, but the front-loading of the fee schedule buries the auth and error guidance toward the end.

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 6-parameter mutation-style builder with no output schema, the description covers everything an agent needs: input alternatives, fee derivation, the returned object shape including the approval ordering requirement, error handling, and authentication. Return-value detail is spelled out inline since no output schema exists.

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: percent is a share of the on-chain wallet balance, and integratorFeeBps overrides a partner default that applies only with X-Trnch-Partner-Key and is refused above 0 without a partner. Slippage defaults and the token-tax raise are left to the schema.

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 clause is a specific verb plus resource plus scope: 'Build a sell for USDG in one call', followed by the routing behavior (quotes eight routers, returns the best route as a transaction to sign). An agent can distinguish this from trnch_buy and trnch_quote without opening a 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?

The description makes the input choice explicit (give tokenId or token, percent of the wallet balance read on chain, or an exact amount) and states the prerequisite of an API key sent as Authorization: Bearer <key>. It also makes clear that Trnch sends nothing, so the agent must sign and broadcast, but it never names when to use this instead of trnch_quote or trnch_buy.

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