prepare_revoke_approval
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...
This record as markdown: /tools/io-github-szhygulin-vaultpilot-mcp/prepare-revoke-approval.md
What prepare_revoke_approval does on VaultPilot MCP
AI agents use prepare_revoke_approval to create or update resources in VaultPilot MCP, usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your VaultPilot MCP environment.
| Parameter | Type | Required | Description |
|---|---|---|---|
chain | string | — | |
token | string | Yes | ERC-20 contract address. Must be the actual token contract — wrappers and aTokens have their own approval surfaces and aren't supported here. |
wallet | string | Yes | EVM 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 ze |
spender | string | Yes | Address whose allowance to revoke. Typically a protocol contract (Aave V3 Pool, Uniswap SwapRouter, etc.) or any EOA the user previously approved. Get the live |
Parameters from the server's own tool schema.
Why prepare_revoke_approval is rated Medium
This tool constructs a token approval transaction setting allowance to zero, which is a reversible on-chain write operation (the allowance can be re-granted later). It does not delete or destroy assets, nor does it move funds — it only modifies a smart contract allowance state. The transaction is unsigned at this stage, requiring a separate signing/broadcast step.
From the tool's definition Build an unsigned `approve(spender, 0)` transaction that revokes the allowance the wallet previously granted to `spender` on `token`
Risk signalsHandles credentials or secrets (token)
Attacks that exploit this kind of access
The rule that runs prepare_revoke_approval safely
PolicyLayer is an MCP gateway: it sits between your AI agents and VaultPilot MCP, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For prepare_revoke_approval, this is the rule to start with:
prepare_revoke_approval stays usable, but capped: an agent stuck in a loop can't make hundreds of changes a minute. Everything else on the server is denied unless you say otherwise.
The button opens the PolicyLayer dashboard: create your workspace, connect VaultPilot MCP, apply this rule, and every prepare_revoke_approval call is checked against it from then on.
Questions about prepare_revoke_approval
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. It is categorised as a Write tool in the VaultPilot MCP MCP Server, which means it can create or modify data. Consider rate limits to prevent runaway writes.
prepare_revoke_approval accepts 4 parameters: chain, token, wallet, spender. Required: token, wallet, spender. The full parameter table on this page comes from the server's own tool schema.
Register the VaultPilot MCP server in PolicyLayer and add a rule for prepare_revoke_approval: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches VaultPilot MCP. Nothing to install.
prepare_revoke_approval is a Write tool with medium risk. Write tools should be rate-limited to prevent accidental bulk modifications.
Yes. Add a rate_limit block to the prepare_revoke_approval rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for prepare_revoke_approval. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
prepare_revoke_approval is provided by the VaultPilot MCP server (vaultpilot-mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on VaultPilot, and thousands of servers like it.
This server
Across the catalogue