x402_convert_atomic_units
Converts exact decimal amounts to integer minor/atomic units and back, rejecting fractional sub-atomic dust instead of rounding it.
Instructions
Exact Decimal string <-> integer minor/atomic unit converter (USD 2, EUR 2, VND 0, JPY 0, KWD 3, USDC 6, sBTC 8, SOL 9, WEI 18) with explicit SUB_ATOMIC_DUST_REJECTED rounding rejection whenever fractional sub-atomic dust is supplied.
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>",
"currency": "<currency>"
},
"name": "x402_convert_atomic_units"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | Exact decimal string (e.g. `'1.25'`, `'0.0005'`) or exact integer atomic value (floats rejected). | |
| currency | Yes | Currency or token code (`USD`, `EUR`, `VND`, `JPY`, `KWD`, `USDC`, `sBTC`, `SOL`, `WEI`). | |
| direction | No | `to_atomic` converts human decimal string -> integer minor units; `from_atomic` converts integer -> decimal string. | to_atomic |
| allow_negative | No | Allow negative values (default `False` for payment amounts). |