Swap tokens on Base (your user sends it)
swap_tokensSwap USDC, EURC or WETH (say ETH; you get WETH, wrapped ETH) on Base through Uniswap, from your user's own wallet. Only when your user turned swaps on (dashboard: Your limits → Swaps) and within their limits (default $50 per swap, $100 a day). It doesn't swap by itself: it quotes the best Uniswap pool, sets the minimum your user gets (their slippage, default 0.5%), approves exactly the amount when needed (never unlimited), has presign-guard check every transaction with a verdict bound to exactly that transaction (red is refused), and returns an approve_url where your user sends it from their own wallet (also sent to their phone). The price holds about 2 minutes; the page can refresh it. Then call swap_status.
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": {
"from_token": "<from_token>",
"to_token": "<to_token>",
"amount": "<amount>"
},
"name": "swap_tokens"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | How much of from_token, like "40" | |
| reason | No | Why, in a few words: shown to your user | |
| to_token | Yes | What your user gets (ETH means WETH) | |
| from_token | Yes | What your user pays with |