Skip to main content
Glama

Buy a token

trnch_buy

Build a buy in one call: quotes six routers and returns the best route as a transaction for the key's wallet to sign. Give tokenId or token, and amountUsd (paid in USDG) or amountIn with tokenIn. The TRNCH fee (0.5%) is already deducted from the quote. Returns { router, quote, approval, tx, chainId, from }: if approval is not null, send it first, then sign and send tx from the same wallet (chainId 4663). Nothing is sent by TRNCH. Errors: 409 token not tradable through TRNCH (kept out by TIA), 429 rate or build limit (retry-after). Requires the API key from trnch_register, sent as Authorization: Bearer .

Input Schema

NameRequiredDescriptionDefault
tokenNoToken to buy, as an address. Use this or tokenId.
tokenIdNoOpaque token id from trnch_heat (field id). Use this or token.
tokenInNoToken paid with amountIn. Default USDG.
amountInNoAmount of tokenIn to spend, smallest unit. Use this or amountUsd.
amountUsdNoAmount to spend in US dollars, paid in USDG. 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.7/5.0
Behavior5/5

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

Adds substantial context beyond the annotations: nothing is actually sent by TRNCH, the 0.5% fee is pre-deducted from the quote, the approval-before-tx ordering, the target chainId 4663, and what each error code (409, 429 with retry-after) means operationally. Authentication requirements are stated explicitly (key from trnch_register, Bearer header).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single dense paragraph that is front-loaded with the action and the call shape, then the return contract, then failure modes, then auth. Every sentence contributes a fact an agent needs; nothing is padding.

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 return contract itself (router, quote, approval, tx, chainId, from) and the sequencing rule for the nullable approval. Combined with the error codes, chain, and auth details, nothing an agent needs to call this correctly is missing.

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 meaning the schema lacks: tokenId originates from trnch_heat's `id` field, amountUsd is settled in USDG, and the fee is already netted out of the quoted amount. It does not discuss slippageBps behavior beyond the default, which the schema already covers.

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?

Opens with a specific verb and resource ("Build a buy") and immediately scopes it: quotes six routers, returns the best route as a signable transaction. This clearly separates it from trnch_quote (price only) and trnch_sell (opposite direction) without needing the schemas.

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?

Gives concrete selection rules for the parameter alternatives ("Give tokenId or token, and amountUsd (paid in USDG) or amountIn with tokenIn") and states the post-call procedure (send approval first, then sign/send tx from the same wallet). It does not explicitly say when to prefer the sibling trnch_quote over this tool, so it stops short of a full routing statement.

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.