token_allowance
Read an ERC-20 allowance before transacting: how much of a token an owner has approved a spender to move, in raw units and formatted with the token's decimals, plus an unlimited flag when the allowance is at or near max uint256 (an unlimited approval is a standing risk worth knowing about). Works on base, ethereum, polygon, arbitrum and optimism. Price: $0.001 USDC on Base via x402.
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": "<token>",
"owner": "<owner>",
"spender": "<spender>"
},
"name": "token_allowance"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain | No | Chain to read: base (default), ethereum, polygon, arbitrum or optimism. | |
| owner | Yes | Address that granted the approval. | |
| token | Yes | ERC-20 token contract address. | |
| spender | Yes | Address approved to spend (a router, exchange or contract). |