{"name":"convert","oldName":"convert_amount","title":"Convert token amounts","category":"tokens","useWhen":"Run before putting any token amount into 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 using 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 to convert, as a string, e.g. \"5\" or \"0.25\".","whereToGet":"The amount the user asked for. A string avoids rounding errors."},{"name":"to","type":"\"raw\" | \"readable\"","required":false,"lookingFor":"Which way to convert. \"raw\" turns 5 into 5000000 (for transactions). \"readable\" turns raw units back into a normal amount. Default \"raw\".","whereToGet":"\"raw\" before building a transaction, \"readable\" when reading raw amounts."},{"name":"network","type":"\"mainnet-beta\" | \"devnet\"","required":false,"lookingFor":"Which Solana network to read. Default \"mainnet-beta\" (real money).","whereToGet":"Leave it out for mainnet. Use \"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"},"amount":{"type":"string"},"to":{"default":"raw","type":"string","enum":["raw","readable","to_base_units","to_ui"]},"network":{"default":"mainnet-beta","type":"string","enum":["mainnet-beta","devnet"]}},"required":["token","amount"]}}