Skip to main content
Glama

audit_token_approvals

Read-onlyIdempotent

chainpeek: List a wallet's live token approvals and get revoke transactions. For tokens already pulled out use check_wallet_drain; for one allowance use get_allowance. Returns the live ERC-20 and Permit2 allowances of wallet: amount or unlimited, spender code (key-controlled, contract, new contract), newest approval and pull, staleness, flags with evidence, and the unsigned revoke transaction that sets it to 0. Candidates: approval events in the latest 6,000 blocks, Permit2, and spenders. High: unlimited to a key-controlled account. Medium: limited to one, or unlimited to a contract with no code 30 days ago. Low: other unlimited or stale. Older approvals are found only via spenders or Permit2. Bad input is a 422, a failed read a 502 (neither charged). Nothing is signed or sent. Typically 3-15 s. Price: USD 0.005. Free: 10 chain reads per IP per UTC day. Docs: https://tanod.dev/learn/token-approval-audit-api.html

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": {
      "chain": "<chain>",
      "wallet": "<wallet>"
    },
    "name": "audit_token_approvals"
  }
}

Input Schema

NameRequiredDescriptionDefault
chainYesbase or ethereum (the chains with built-in USDC and USDT here).
tokensNoUp to 50 token contracts to audit. Default: USDC, USDT and up to 18 tokens the wallet has sent (from its transfer history).
walletYesThe wallet whose approvals are audited (0x + 40 hex).
spendersNoUp to 50 spender addresses whose ERC-20 and Permit2 allowances are read directly on every audited token, however old (tokens x spenders at most 200). The full-coverage path for spenders you know.
stale_daysNoAn allowance is stale when the spender pulled nothing from the wallet in this many days.
lookback_blocksNoLatest blocks scanned for approval events (0-6,000; default 6,000, about 20 minutes on Base today and 20 hours on Ethereum; `history.from_time` says when the window starts). 0 scans nothing and checks `spenders` and Permit2 only.

Output Schema

NameRequiredDescriptionDefault
riskNo
blockNo
chainNo
errorNoOnly on an error result: an object {code, message}, or the reason string of an x402 PaymentRequired object.
rulesNo
limitsNo
tokensNo
walletNo
checkedNo
historyNo
reasonsNo
rpc_callsNo
allowancesNo
stale_daysNo
block_timestampNo
allowances_totalNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed15 schema fields changed
    • removedInput schema / properties / chain / title
      Removed value: -"Chain"
    • removedInput schema / properties / lookback_blocks / title
      Removed value: -"Lookback Blocks"
    • removedInput schema / properties / spenders / default
      Removed value: -null
    • removedInput schema / properties / spenders / title
      Removed value: -"Spenders"
    • changedInput schema / properties / stale_days / description
      Previous value: -"An allowance is stale when the spender pulled nothing from the wallet in this many days (1-3,650; default 90)."New value: +"An allowance is stale when the spender pulled nothing from the wallet in this many days."
    • removedInput schema / properties / stale_days / title
      Removed value: -"Stale Days"
    • removedInput schema / properties / tokens / default
      Removed value: -null
    • removedInput schema / properties / tokens / title
      Removed value: -"Tokens"
    • removedInput schema / properties / wallet / title
      Removed value: -"Wallet"
    • removedInput schema / title
      Removed value: -"audit_token_approvalsArguments"
    • removedOutput schema / properties / allowances / items
      Removed value: -{
      -  "properties": {
      -    "amount": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "amount_raw": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "approved_age_s": {
      -      "type": [
      -        "integer",
      -        "null"
      -      ]
      -    },
      -    "approved_before_block": {
      -      "type": [
      -        "integer",
      -        "null"
      -      ]
      -    },
      -    "approved_block": {
      -      "type": [
      -        "integer",
      -        "null"
      -      ]
      -    },
      -    "approved_event": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "approved_tx": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "decimals": {
      -      "type": [
      -        "integer",
      -        "null"
      -      ]
      -    },
      -    "expiration": {
      -      "type": [
      -        "integer",
      -        "null"
      -      ]
      -    },
      -    "flags": {
      -      "items": {
      -        "properties": {
      -          "code": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "evidence": {
      -            "type": [
      -              "object",
      -              "null"
      -            ]
      -          },
      -          "severity": {
      -            "enum": [
      -              "high",
      -              "medium",
      -              "low",
      -              "info",
      -              "ok",
      -              null
      -            ],
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          }
      -        },
      -        "type": [
      -          "object",
      -          "null"
      -        ]
      -      },
      -      "type": [
      -        "array",
      -        "null"
      -      ]
      -    },
      -    "kind": {
      -      "enum": [
      -        "erc20",
      -        "permit2",
      -        null
      -      ],
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "last_pull": {
      -      "type": [
      -        "object",
      -        "null"
      -      ]
      -    },
      -    "revoke": {
      -      "properties": {
      -        "data": {
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        },
      -        "to": {
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        },
      -        "value": {
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        }
      -      },
      -      "type": [
      -        "object",
      -        "null"
      -      ]
      -    },
      -    "severity": {
      -      "enum": [
      -        "high",
      -        "medium",
      -        "low",
      -        "info",
      -        "ok",
      -        null
      -      ],
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "sources": {
      -      "items": {
      -        "type": [
      -          "string",
      -          "null"
      -        ]
      -      },
      -      "type": [
      -        "array",
      -        "null"
      -      ]
      -    },
      -    "spender": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "spender_code": {
      -      "properties": {
      -        "code_size": {
      -          "type": [
      -            "integer",
      -            "null"
      -          ]
      -        },
      -        "is_eoa": {
      -          "type": [
      -            "boolean",
      -            "null"
      -          ]
      -        },
      -        "kind": {
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        },
      -        "known": {
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        },
      -        "new_contract": {
      -          "type": [
      -            "boolean",
      -            "null"
      -          ]
      -        },
      -        "read": {
      -          "type": [
      -            "boolean",
      -            "null"
      -          ]
      -        }
      -      },
      -      "type": [
      -        "object",
      -        "null"
      -      ]
      -    },
      -    "stale": {
      -      "type": [
      -        "boolean",
      -        "null"
      -      ]
      -    },
      -    "token": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "token_symbol": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "unlimited": {
      -      "type": [
      -        "boolean",
      -        "null"
      -      ]
      -    },
      -    "unlimited_basis": {
      -      "enum": [
      -        "max",
      -        "above_supply",
      -        null
      -      ],
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "usage_checked": {
      -      "type": [
      -        "boolean",
      -        "null"
      -      ]
      -    }
      -  },
      -  "type": [
      -    "object",
      -    "null"
      -  ]
      -}
    • removedOutput schema / properties / history / properties
      Removed value: -{
      -  "approval_events": {
      -    "type": [
      -      "integer",
      -      "null"
      -    ]
      -  },
      -  "blocks": {
      -    "type": [
      -      "integer",
      -      "null"
      -    ]
      -  },
      -  "code_reads": {
      -    "type": [
      -      "integer",
      -      "null"
      -    ]
      -  },
      -  "complete": {
      -    "type": [
      -      "boolean",
      -      "null"
      -    ]
      -  },
      -  "contracts_not_scanned": {
      -    "type": [
      -      "integer",
      -      "null"
      -    ]
      -  },
      -  "contracts_scanned": {
      -    "type": [
      -      "integer",
      -      "null"
      -    ]
      -  },
      -  "from_block": {
      -    "type": [
      -      "integer",
      -      "null"
      -    ]
      -  },
      -  "from_time": {
      -    "type": [
      -      "string",
      -      "null"
      -    ]
      -  },
      -  "new_code_block": {
      -    "type": [
      -      "integer",
      -      "null"
      -    ]
      -  },
      -  "permit2_events": {
      -    "type": [
      -      "integer",
      -      "null"
      -    ]
      -  },
      -  "read": {
      -    "type": [
      -      "boolean",
      -      "null"
      -    ]
      -  },
      -  "sent_before_window": {
      -    "type": [
      -      "integer",
      -      "null"
      -    ]
      -  },
      -  "shrunk": {
      -    "type": [
      -      "boolean",
      -      "null"
      -    ]
      -  },
      -  "to_block": {
      -    "type": [
      -      "integer",
      -      "null"
      -    ]
      -  },
      -  "to_time": {
      -    "type": [
      -      "string",
      -      "null"
      -    ]
      -  },
      -  "transfer_history": {
      -    "type": [
      -      "string",
      -      "null"
      -    ]
      -  },
      -  "transfer_history_rows": {
      -    "type": [
      -      "integer",
      -      "null"
      -    ]
      -  },
      -  "transfer_history_truncated": {
      -    "type": [
      -      "boolean",
      -      "null"
      -    ]
      -  },
      -  "transfers_out_in_window": {
      -    "type": [
      -      "integer",
      -      "null"
      -    ]
      -  },
      -  "tx_lookup_cap": {
      -    "type": [
      -      "integer",
      -      "null"
      -    ]
      -  },
      -  "tx_lookups": {
      -    "type": [
      -      "integer",
      -      "null"
      -    ]
      -  }
      -}
    • removedOutput schema / properties / limits / items
      Removed value: -{
      -  "type": [
      -    "string",
      -    "null"
      -  ]
      -}
    • removedOutput schema / properties / reasons / items
      Removed value: -{
      -  "properties": {
      -    "code": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "evidence": {
      -      "type": [
      -        "object",
      -        "null"
      -      ]
      -    },
      -    "message": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "severity": {
      -      "enum": [
      -        "high",
      -        "medium",
      -        "low",
      -        "info",
      -        "ok",
      -        null
      -      ],
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    }
      -  },
      -  "type": [
      -    "object",
      -    "null"
      -  ]
      -}
    • removedOutput schema / properties / tokens / items
      Removed value: -{
      -  "properties": {
      -    "balance": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "balance_raw": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "decimals": {
      -      "type": [
      -        "integer",
      -        "null"
      -      ]
      -    },
      -    "source": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "token": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "token_symbol": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "total_supply_raw": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    }
      -  },
      -  "type": [
      -    "object",
      -    "null"
      -  ]
      -}
  2. Changed1 schema field changed
    • changedInput schema / properties / lookback_blocks / description
      Previous value: -"Latest blocks scanned for approval events (0-6,000; default 6,000, about 20 minutes on Base at its current 0.2 s block time and 20 hours on Ethereum; `history.from_time` says when the window starts). 0 scans nothing and checks `spenders` and Permit2 only."New value: +"Latest blocks scanned for approval events (0-6,000; default 6,000, about 20 minutes on Base today and 20 hours on Ethereum; `history.from_time` says when the window starts). 0 scans nothing and checks `spenders` and Permit2 only."
  3. Changed4 schema fields changed
    • changedInput schema / properties / lookback_blocks / description
      Previous value: -"Latest blocks scanned for approval events (0-6,000; default 6,000, about 3.3 hours on Base and 20 hours on Ethereum). 0 scans nothing and checks `spenders` and Permit2 only."New value: +"Latest blocks scanned for approval events (0-6,000; default 6,000, about 20 minutes on Base at its current 0.2 s block time and 20 hours on Ethereum; `history.from_time` says when the window starts). 0 scans nothing and checks `spenders` and Permit2 only."
    • addedOutput schema / properties / history / properties / from_time
      Added value: +{
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / history / properties / new_code_block
      Added value: +{
      +  "type": [
      +    "integer",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / history / properties / to_time
      Added value: +{
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
  4. Changed9 schema fields changed
    • addedOutput schema / properties / history / properties / approval_events
      Added value: +{
      +  "type": [
      +    "integer",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / history / properties / code_reads
      Added value: +{
      +  "type": [
      +    "integer",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / history / properties / contracts_not_scanned
      Added value: +{
      +  "type": [
      +    "integer",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / history / properties / contracts_scanned
      Added value: +{
      +  "type": [
      +    "integer",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / history / properties / permit2_events
      Added value: +{
      +  "type": [
      +    "integer",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / history / properties / transfer_history_rows
      Added value: +{
      +  "type": [
      +    "integer",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / history / properties / transfer_history_truncated
      Added value: +{
      +  "type": [
      +    "boolean",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / history / properties / transfers_out_in_window
      Added value: +{
      +  "type": [
      +    "integer",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / history / properties / tx_lookup_cap
      Added value: +{
      +  "type": [
      +    "integer",
      +    "null"
      +  ]
      +}
  5. Added

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already cover safety (readOnly, idempotent, non-destructive), and the description still adds real substance beyond them: nothing is signed or sent, 422 vs 502 with neither charged, 3-15 s latency, price and free-tier quota. What it does not do is explain pagination or result-count limits, so it falls just short of full marks.

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?

Purpose and alternatives are front-loaded, and the risk-tier sentences (High/Medium/Low) carry genuine decision value. The prose is telegraphic and dense - heavy semicolon stacking - but no sentence is padding.

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?

Complete for a read-only audit tool: inputs, failure modes, timing, and cost are all covered, and an output schema exists so the return-shape listing is a bonus rather than a requirement. Minor gap on what happens when the token x spender product exceeds the cap.

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?

Schema coverage is already 100%, so the baseline is 3; the description earns the extra point by interpreting the parameters operationally - the lookback window is roughly 20 minutes on Base versus 20 hours on Ethereum, and `spenders` is described as the full-coverage path with a 200-combination ceiling. It adds meaning rather than restating field 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?

"List a wallet's live token approvals and get revoke transactions" is a specific verb+resource pair, and the description immediately names the siblings it is not (check_wallet_drain for already-drained tokens, get_allowance for a single allowance). An agent can route correctly from the first sentence alone.

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 when-to-use-elsewhere routing is given with conditions attached for both named alternatives, plus a key coverage caveat: older approvals are only found via `spenders` or Permit2, and `lookback_blocks: 0` turns the event scan off. That is the exclusion and edge-case detail most definitions omit.

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.

Resources