Skip to main content
Glama

prepare_revoke_approval

DestructiveIdempotent

Build an unsigned transaction to revoke an ERC-20 token allowance by setting the spender's allowance to zero. Pre-flight check prevents gas waste if 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.
Behavior4/5

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

Annotations indicate `destructiveHint=true` and `idempotentHint=true`. The description adds the pre-flight check that prevents gas waste when allowance is already 0, label resolution for readability, and the EVM-only constraint. This provides useful behavioral context beyond annotations.

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 description is a single paragraph but well-organized: core action, pre-flight check, label resolution, EVM note, pairing advice. It avoids redundancy and front-loads essential information. Could benefit from bullet points for easier scanning, but still efficient.

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 (building a transaction with pre-flight check and label resolution), the description covers all key aspects: action, safety check, readability enhancement, platform specificity, and pairing with a read tool. No output schema is provided, but the return value (an unsigned transaction) is implied by the 'prepare' pattern.

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?

Input schema describes all four parameters with `description` fields. The description adds meaningful nuance: `spender` is typically a protocol or EOA, `token` must be the exact ERC-20 contract (not wrappers), `wallet` must be the original owner. This enriches the schema definitions.

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 verb (revoke), resource (allowance), and distinguishes from related tools like `prepare_token_approve` (for setting non-zero allowances) and `prepare_tron_trc20_revoke` (for TRON). The pre-flight check and label resolution further clarify the purpose.

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?

Explicit guidance: use to revoke an allowance, refuse to proceed if allowance is already 0, pair with `get_token_allowances` to enumerate current approvals. Differentiates from TRON equivalent and warns about EVM-only context.

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