Ensure gas
agentgas_ensure_gasFree. Checks a wallet's native gas balance on base/arbitrum/optimism/polygon. If it is at least min, returns needed:false (nothing to pay). Otherwise returns the exact top-up to reach target (default 2 x min), the price with your loyalty fee, an x402 URL to pay (pay_with_x402.url) and, if you hold AgentGas credit, a ready-to-sign credit message (pay_with_credit). Call before each on-chain action.
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": {
"to": "<to>",
"min": "<min>"
},
"name": "agentgas_ensure_gas"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Wallet to check / top up | |
| min | Yes | Minimum native balance needed, e.g. 0.00002 | |
| chain | No | Destination chain for the native gas | |
| payer | No | Paying wallet (loyalty fee, credit). Defaults to to. | |
| target | No | Balance to top up to (default 2 x min) |