Skip to main content
Glama

prepare_revoke_approval

DestructiveIdempotent

Revokes an ERC-20 token allowance by building an unsigned transaction to set the approved amount to zero. Includes a pre-flight check to avoid gas waste if the allowance is already zero.

Instructions

Build an unsigned approve(spender, 0) transaction that revokes the allowance the wallet previously granted to spender on token. Pre-flight check refuses when the live allowance is already 0 — that call would burn gas for nothing, and almost certainly means the user named the wrong (token, spender) pair. Resolves a friendly spender label from the canonical CONTRACTS table when one matches (Aave V3 Pool, Uniswap V3 SwapRouter02, Lido stETH, Compound V3 cUSDCv3, Morpho Blue, etc.) so the description + Ledger preview reads as "Revoke USDC allowance for Aave V3 Pool (0x...)" instead of a raw hex address. Description includes the previous allowance amount so the user sees what's being zeroed out. EVM-only — TRC-20 has the same approve(spender, value) shape but its prepare path runs through the TRON builder pipeline; surface in a prepare_tron_trc20_revoke if asked. Pair with the read-side get_token_allowances to enumerate what's currently approved.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
walletYesEVM wallet that owns the existing allowance. Must be the address that originally called approve(spender, value); only the owner can set the allowance back to zero.
chainNoethereum
tokenYesERC-20 contract address. Must be the actual token contract — wrappers and aTokens have their own approval surfaces and aren't supported here.
spenderYesAddress whose allowance to revoke. Typically a protocol contract (Aave V3 Pool, Uniswap SwapRouter, etc.) or any EOA the user previously approved. Get the live list via the read-side allowances tool.
Behavior5/5

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

Beyond annotations (destructiveHint, idempotentHint), the description adds crucial details: pre-flight check that refuses zero allowances, resolution of friendly spender labels, inclusion of previous allowance in description, and EVM-only constraint. This gives the agent a complete picture of the tool's behavior.

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 and concise, with each sentence adding unique value. It front-loads the core action, then covers pre-flight checks, label resolution, and TRC-20 distinction. No redundant or irrelevant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (4 parameters, no output schema), the description is quite complete. It explains the output (unsigned transaction) and workflow, but could be slightly more explicit about the return structure (e.g., that it returns a transaction object). However, it covers the key aspects for an agent to use 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?

The input schema already provides good descriptions for wallet, token, and spender. The description adds value by explaining the label resolution for spender and that the tool includes the previous allowance in the preview. This enhances semantic understanding beyond the schema alone.

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 tool builds an unsigned approve(spender, 0) transaction to revoke an allowance. It specifies the resource (allowance on token for spender) and distinguishes from siblings by noting EVM-only and TRC-20 is handled by a different tool. The verb 'revoke' is specific and matches common user intent.

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 advises pairing with get_token_allowances to list current approvals. It warns against using when the allowance is already 0, calling it a likely wrong pair. It also points to prepare_tron_trc20_revoke for TRC-20 tokens, providing clear alternatives.

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