{"name":"convert","oldName":"convert_amount","title":"Convert token amounts","category":"tokens","useWhen":"Run before putting any token amount in a transaction. \"5 USDC\" is 5,000,000 raw units; wrong decimals send 1,000x too much or too little.","benefit":{"kind":"money","text":"5 USDC is 5,000,000 raw units because USDC has 6 decimals. Get the decimals wrong and you send 1,000 times too much or too little."},"description":"Converts between normal amounts and raw units with the token's real on-chain decimals.","price":"$0.01","priceText":"25 free calls a day, then $0.01 USDC per call (x402)","http":{"method":"POST","path":"/api/tools/convert","body":"JSON object with the inputs below"},"mcp":{"method":"tools/call","name":"convert"},"inputs":[{"name":"token","type":"string (token address) or \"SOL\"","required":true,"lookingFor":"The token, or \"SOL\" for SOL (9 decimals).","whereToGet":"From find_token or tokens."},{"name":"amount","type":"string (decimal)","required":true,"lookingFor":"The amount, as a string: \"5\" or \"0.25\".","whereToGet":"The user's amount. A string avoids rounding errors."},{"name":"to","type":"\"raw\" | \"readable\"","required":false,"lookingFor":"Direction. \"raw\" turns 5 into 5000000 (for transactions); \"readable\" turns raw units back. Default \"raw\".","whereToGet":"\"readable\" for amounts read from chain data."},{"name":"network","type":"\"mainnet-beta\" | \"devnet\"","required":false,"lookingFor":"Default \"mainnet-beta\" (real money).","whereToGet":"\"devnet\" only for test wallets."}],"outputs":[{"field":"token","type":"string","is":"The token converted (SOL's own address for SOL).","howWorkedOut":"Your input. \"SOL\" becomes So11111111111111111111111111111111111111112."},{"field":"symbol","type":"string | null","is":"Ticker from Jupiter, for display only.","howWorkedOut":"Jupiter token search by address."},{"field":"decimals","type":"number","is":"Decimal places the token uses.","howWorkedOut":"Read from the token on chain (SOL is always 9)."},{"field":"decimals_from","type":"string","is":"Where the decimals came from, so you can trust them.","howWorkedOut":"\"on-chain token\" or \"SOL (fixed)\"."},{"field":"raw_amount","type":"string (integer)","is":"The amount in raw units, exactly as it goes into a transfer.","howWorkedOut":"amount x 10^decimals with exact integer math. Refuses more decimal places than the token has."},{"field":"amount","type":"string (decimal)","is":"The normal, readable amount.","howWorkedOut":"raw_amount / 10^decimals with exact integer math."},{"field":"summary","type":"string","is":"One sentence stating the conversion.","howWorkedOut":"Built from the values above."}],"notes":[],"inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"token":{"type":"string","description":"The token, or \"SOL\" for SOL (9 decimals). From find_token or tokens."},"amount":{"type":"string","description":"The amount, as a string: \"5\" or \"0.25\". The user's amount. A string avoids rounding errors."},"to":{"default":"raw","description":"Direction. \"raw\" turns 5 into 5000000 (for transactions); \"readable\" turns raw units back. Default \"raw\". \"readable\" for amounts read from chain data.","type":"string","enum":["raw","readable","to_base_units","to_ui"]},"network":{"default":"mainnet-beta","description":"Default \"mainnet-beta\" (real money). \"devnet\" only for test wallets.","type":"string","enum":["mainnet-beta","devnet"]}},"required":["token","amount"]}}