cast_convert
Convert Ethereum value formats such as wei, hex, decimal, bytes32, and custom bases to support smart contract and on-chain data handling.
Instructions
Convert between Ethereum value formats (cast to-wei, from-wei, to-hex, to-dec, to-bytes32, to-base).
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": {
"operation": "<operation>",
"value": "<value>"
},
"name": "cast_convert"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base | No | Output base for to-base operation (e.g. 16 for hex, 2 for binary) | |
| unit | No | Unit for wei conversions (e.g. ether, gwei). Default: ether | |
| value | Yes | Value to convert | |
| baseIn | No | Input base for to-base operation (e.g. 16 if input is hex) | |
| operation | Yes | Conversion operation to perform |