Skip to main content
Glama

ChainGuard Web3 Security & DeFi MCP

build_erc20_approval_revoke

Read-onlyIdempotent

Construct unsigned non-custodial EVM calldata (approve(spender, 0), selector 0x095ea7b3) to revoke an open ERC-20 token allowance granted to a router or spender contract on any of 8 EVM networks. Read-only calldata generator: never signs or broadcasts transactions (unlimited free calls, 0% fee). Returns JSON with network, to (token contract), spender, data (68-byte hex calldata), value (0x0), and eip5792_call ready for wallet signing.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "token_address": "<token_address>",
      "spender": "<spender>"
    },
    "name": "build_erc20_approval_revoke"
  }
}

Input Schema

NameRequiredDescriptionDefault
networkNoTarget EVM chain where the ERC-20 allowance exists. Defaults to `base`.base
spenderYes42-character hexadecimal router or spender contract address (`0x...`) whose spending permission is being revoked.
token_addressYes42-character hexadecimal ERC-20 token contract address (`0x...`) whose allowance will be reset to zero.

Output Schema

NameRequiredDescriptionDefault
toYes
dataYes
valueNo
networkYes
spenderNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, and openWorldHint=false. The description adds valuable context beyond annotations: never signs or broadcasts, unlimited free calls, 0% fee, and the exact JSON return structure including `eip5792_call`. It could still clarify error behavior or network-specific caveats, but the added detail is substantial.

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?

Two well-structured sentences that front-load the core action and then detail the return value. It is dense but every clause contributes useful information, with no obvious filler or repetition.

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 (mutation-adjacent calldata generation but read-only in effect), rich annotations, full parameter schema, and an output schema, the description provides sufficient context: what it does, what it returns, networks supported, and safety guarantees. Slight gaps remain around error handling and explicit alternative routing, but overall it is complete for an agent to call it correctly.

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

Parameters3/5

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

With 100% schema description coverage, the schema fully documents the three parameters including defaults and enum values. The description mentions `spender` and token contract in prose but adds no syntax, format, or validation details beyond what the schema already provides, so baseline 3 is appropriate.

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?

States a specific verb and resource: constructs unsigned EVM calldata for `approve(spender, 0)` to revoke an ERC-20 allowance, and names the selector and 68-byte calldata format. This clearly distinguishes it from sibling build_* tools that perform sweeps or consolidation.

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

Usage Guidelines4/5

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

The context 'to revoke an open ERC-20 token allowance granted to a router or spender contract' clearly indicates when to use this tool versus granting or other actions, and it notes the tool never signs or broadcasts. It does not explicitly name alternatives or exclusions, but the intended scenario is unambiguous.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.