Skip to main content
Glama

prepare_tron_trc20_approve

DestructiveIdempotent

Build unsigned TRC-20 approve transaction to authorize a spender (e.g., LiFi Diamond) for token transfer. Pass exact decimal amount; unbounded approvals unsupported.

Instructions

Build an unsigned TRC-20 approve(spender, amount) tx — sets allowance so a third party can pull tokens via transferFrom. Primary use: authorize the LiFi Diamond on TRON (TU3ymitEKCWQFtASkEeHaPb8NfZcJtCHLt) before running prepare_tron_lifi_swap with a TRC-20 source token (LiFi's quote response assumes the approve already exists; insufficient allowance reverts the swap on-chain). Accepts ANY TRC-20 contract — not just the canonical set. Decimals are auto-resolved for canonical USDT/USDC/USDD/TUSD; for any other TRC-20 you MUST pass decimals explicitly. We REFUSE to default decimals on approve because an off-by-power-of-ten allowance silently authorizes a 10^12-fold larger spend than intended, with no UX recovery on a Ledger blind-sign flow. amount is a human decimal string ("100" = 100 tokens at the resolved decimals). "max" / unbounded approvals are NOT supported — pass exactly the amount you intend to swap. Returns a preview + opaque handle for send_transaction.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fromYesBase58 TRON owner address — the wallet that holds the tokens.
tokenYesBase58 TRC-20 contract address. Any TRC-20 is accepted; non-canonical tokens require `decimals`.
spenderYesBase58 TRON address authorized to pull tokens via transferFrom. Typical use: the LiFi Diamond on TRON (TU3ymitEKCWQFtASkEeHaPb8NfZcJtCHLt) for `prepare_tron_lifi_swap` flows.
amountYesAllowance amount as a human-readable decimal string. Pass exactly the amount you intend to swap, NOT "max" / unbounded — TRC-20 unbounded approvals are a known griefing vector and we don't expose them by default.
decimalsNoToken decimals. OPTIONAL when `token` is in the canonical TRC-20 set (USDT/USDC=6, USDD/TUSD=18 — auto-resolved). REQUIRED for any other TRC-20 contract; we refuse to guess decimals when an off-by-power-of-ten allowance could authorize a 10^12-fold larger spend than intended.
feeLimitTrxNoOptional fee-limit override in TRX. Defaults to 100 TRX (TronLink/Ledger Live standard).
Behavior5/5

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

Beyond annotations, it discloses crucial behavioral details: refusal to default decimals due to safety risks with Ledger blind-sign, unsupported unbounded approvals, and return format (preview + opaque handle). No contradiction with annotations.

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?

The description is well-structured, front-loading purpose, and every sentence provides essential information. Length is appropriate given the tool's complexity.

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?

Fully covers the tool's purpose, usage context, parameter details, return value, and important warnings. Sufficient for an agent to invoke correctly without additional information.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Despite 100% schema coverage, the description adds significant meaning for each parameter, including the primary spender use, canonical token set for decimals, human-readable amount format, and fee limit default.

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 clearly states it builds an unsigned TRC-20 approve transaction, specifying the verb and resource with precise scope. It distinguishes from sibling tools by mentioning its primary use with LiFi and linking to prepare_tron_lifi_swap.

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

Usage Guidelines5/5

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

Explicitly states when to use (authorize LiFi before swap) and when not to use (no 'max' approvals, must provide decimals for non-canonical tokens). Provides clear context and constraints.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/szhygulin/recon-crypto-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server