approve_permit2
Grants a one-time ERC-20 allowance to the Permit2 contract so an agent can pay x402 "upto" endpoints with that token; set an amount to bound the approval, since maximum is refused by default.
Instructions
One-time ERC-20 approval of a token to the Permit2 contract, needed before paying x402 "upto" endpoints with that token. A normal on-chain transaction (needs gas). Pass amount to grant a bounded allowance; with no amount it asks for the maximum, which is refused by default, under AGENTWALLET_MAX_TX_TOKEN, and always under a spend policy (where the allowance counts against the budgets). Only the operator can allow a maximum approval, with AGENTWALLET_ALLOW_UNLIMITED_APPROVAL=1 while no policy is set. Permit2 itself only moves what each signed authorization allows.
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": {
"wallet_id": "<wallet_id>",
"token": "<token>",
"chain_id": "<chain_id>"
},
"name": "approve_permit2"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| token | Yes | ERC-20 token address (e.g. USDC on Base) | |
| amount | No | Allowance to grant in human units (e.g. "100"). Omit for unlimited. | |
| chain_id | Yes | Chain ID | |
| wallet_id | Yes | Wallet ID |