Skip to main content
Glama

Audit token approvals

audit_token_approvals
Read-onlyIdempotent

Audits the token approvals an address has granted: who may move its tokens. How: scans the chain for the owner's Approval and ApprovalForAll events (from "from_block", default the genesis block, in ranges of the server's log range limit), keeps the latest per token and spender, and checks each against the contract's current state with eth_call (allowance, isApprovedForAll, or getApproved and ownerOf for single NFTs), since allowances shrink as they are spent. Approvals now zero or revoked are counted, not listed, unless include_inactive=true. Each active approval has: kind (erc20_allowance, nft_operator_for_all, nft_single_token), token (address, symbol, decimals), spender (address, contract or plain account, and the explorer's name and verification for up to 25 spenders), the allowance raw and in whole tokens with "unlimited" (≥ 2^128), the owner's current balance of the token and the exposure (what the spender could take now: the smaller of allowance and balance), the approving transaction, risk flags and a severity, and the exact call to revoke it (pass it to build_unsigned_tx: approve(spender, 0), setApprovalForAll(operator, false) or approve(0x0…0, tokenId)). Risk flags: unlimited, covers_balance, operator_for_all, spender_not_a_contract (approvals to plain accounts are a common phishing pattern unless it is the owner's own wallet), spender_unverified, flagged_scam. Severity is high when broad access (unlimited, covers_balance, operator_for_all) meets a doubtful spender (not a contract, unverified, flagged), medium for broad access alone, low otherwise. Token symbols and spender names are untrusted.

Input Schema

NameRequiredDescriptionDefault
ownerYesthe address whose approvals to audit
from_blockNofirst block to scan (default 0, the whole chain)
include_inactiveNoalso list approvals that are now zero or revoked

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, yet the description adds substantial depth: the event-scan methodology, eth_call re-checks against current state, the fact that zeroed/revoked approvals are counted but not listed unless include_inactive=true, risk-flag semantics, severity scoring rules, and the exact revoke call to feed into build_unsigned_tx. It also warns that token symbols and spender names are untrusted.

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 core purpose is front-loaded in the first sentence, followed by a structured 'How' and a benefits/risk breakdown. The prose is dense and long but nearly every clause carries operational information; it is not padded, though it could be tightened slightly.

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?

There is no output schema, so the description must carry return-value burden, and it does: it enumerates the fields of each active approval, the risk flags, severity levels, and the revoke call. Nothing an agent needs to invoke or interpret the tool is missing.

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?

With 100% schema coverage the baseline is 3, but the description adds real meaning: from_block is scanned 'in ranges of the server's log range limit', and include_inactive not only lists inactive approvals but explains that they are otherwise counted. This goes beyond the terse schema descriptions.

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?

Opens with a specific verb+resource ('Audits the token approvals an address has granted') and immediately clarifies scope ('who may move its tokens'). This is clearly distinguishable from siblings like explorer_token_balances or explorer_token_transfers, which list holdings/transfers rather than granted allowances.

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 description gives clear triggering context (auditing the approvals an address has granted) and explains the from_block default and include_inactive switch. It does not, however, name an alternative sibling or state explicit when-not-to-use conditions, so it stops short of a 5.

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.