Skip to main content
Glama

Buy a token

trnch_buy

Build a buy in one call: quotes five routers and returns the best route as a transaction for the key's wallet to sign. Give token, and amountUsd (paid in USDC) or amountIn with tokenIn (the zero address pays in HYPE). 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). 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_buy"
  }
}

Input Schema

NameRequiredDescriptionDefault
tokenYesToken to buy, as an address.
tokenInNoToken paid with amountIn. Default USDC.
amountInNoAmount of tokenIn to spend, smallest unit. Use this or amountUsd.
amountUsdNoAmount to spend in US dollars, paid in USDC. Use this or amountIn.
slippageBpsNoMax slippage in basis points (100 = 1%). Default 100.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the annotations (which only say non-read-only, open-world, non-idempotent, non-destructive), the description discloses that the Trnch fee is pre-deducted from the quote, that nothing is sent by Trnch, that the caller must sign and submit, and enumerates specific error semantics (503 unconfigured fee recipient, 404 no route, 429 retry-after with limit, API key via Bearer). This is exactly the behavioral context annotations cannot carry.

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 dense but front-loaded: the core behavior and return shape come first, then calling modes, then errors and auth. Every sentence carries information, though the return-shape enumeration and error list make it longer than strictly necessary for a single call.

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?

There is no output schema, and the description compensates by listing the exact response fields (router, feeBps, quote, approval, tx, chainId, from) and the ordering constraint between approval and tx. Auth requirements, error paths, and the non-custodial signing model are all covered, so an agent has enough to call it 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 schema already documents all five parameters and the baseline would be 3. The description nevertheless adds meaning not in the schema: that amountUsd is settled in USDC, that tokenIn defaults to USDC, and that a zero-address tokenIn means paying in HYPE. It also explains that feeBps is the rate actually applied.

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 names a specific verb and resource (build a buy) and states the mechanism: quotes five routers and returns the best route as a signable transaction. This clearly separates it from trnch_sell and from a quote-only tool without needing to name a sibling.

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?

It gives clear conditions for the two calling modes (token + amountUsd paid in USDC, or amountIn with tokenIn, zero address paying in HYPE) and specifies post-call behavior: approval must be sent before tx from the same wallet. What is absent is explicit routing guidance versus trnch_quote (e.g. preview vs build), so it is clear context but not full when/when-not framing.

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