Skip to main content
Glama

prepare_tron_trc20_approve

DestructiveIdempotent

Build an unsigned TRC-20 approve transaction to set allowance for a spender, enabling token transfers via transferFrom. Requires exact amount; decimal auto-resolution for canonical tokens.

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?

The description adds significant behavioral context beyond annotations: refusal to default decimals with a clear safety rationale, and return value specification. Annotations indicate destructiveHint=true, and the description aligns with that by warning about off-by-power-of-ten. No contradiction.

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 with front-loaded purpose, then usage, constraints, and safety rationale. Every sentence adds value without verbosity.

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 complex tool with 6 parameters and no output schema, the description explains the return value and all important constraints. It covers purpose, usage, special cases, and safety warnings, making it complete for agent invocation.

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 baseline is 3. The description adds meaningful context: clarifies spender typical use, amount as human decimal string with 'max' unsupported, and decimals refusal reason. Provides extra clarity beyond 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 description clearly states the verb 'Build an unsigned TRC-20 approve tx' and the specific resource. It distinguishes itself from sibling prepare_* tools by specifying it's for TRC-20 approve and for use before 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?

The description explicitly states the primary use case (authorize LiFi Diamond before prepare_tron_lifi_swap), what not to do (no unbounded approvals), and when it's required (pass decimals for non-canonical tokens). It provides clear guidance on when to use vs. avoid.

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/vaultpilot-mcp'

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