Token unit converter
util_unitsUse when an agent must turn an on-chain integer into a human amount, or back, without losing money to rounding: converts between wei, gwei, ether and any token decimals with exact integer maths, no floating point. Being off by a factor of a thousand on decimals is the mistake that costs real funds. Do not use to find a token's decimals (/v1/evm/token-info returns them). No API key, no account. $0.005 per call, paid over x402 (USDC).
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": {
"amount": "<amount>",
"from": "<from>",
"to": "<to>"
},
"name": "util_units"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | wei | gwei | ether, or a number of decimals. | |
| from | Yes | wei | gwei | ether, or a number of decimals. | |
| amount | Yes | The quantity, as a string to avoid float loss. |