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, unlimited, spender code (key-controlled, contract, new contract), newest approval and pull, stale, flags with evidence, and revoke, the unsigned 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

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources