safe_approve
Exact-amount approve calldata — never unlimited — Unlimited allowances are the #1 drain vector, and agents reach for approve(max) on every swap. This builds ready-to-sign calldata for an approval of EXACTLY the amount you need (via the token's decimals) and refuses unlimited unless forced. Reads the live allowance and returns a revoke step first when one is already set (a non-zero→non-zero approve reverts on USDT-style tokens). Build-time prevention, not detection; we never hold keys. Not financial advice. Required inputs: token, spender, amount. Priced $0.02 per call over x402 on Base; send a prepaid x-credit-token header for unlimited calls, or get 1 free call/day per tool. No API key required.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner | No | Your wallet (optional, reads live allowance) | |
| token | Yes | Token contract | |
| amount | Yes | Exact amount to approve (or 'max') | |
| spender | Yes | Spender (router/contract) | |
| allowUnlimited | No | Allow unlimited (1 = yes, not recommended) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | The result payload. Shape is service-specific; every field is documented in the tool description. | |
| service | No | The service id that answered. | |
| checkedAt | No | ISO-8601 timestamp of when the underlying reads were taken. |