{"uid":"cap__NPIilrUNe1SF373hdocB","slug":"agent402-uk-token-amount-scaler-f14bed69","name":"Agent402 UK Token Amount Scaler","description":"Don't burn tokens on deterministic work. Go/no-go jobs first: payout preflight, text firewall (PII/secrets), budget check — then rails, calendars, finmath. x402 USDC on Base. UK + global. agent402.co.uk — not agent402.tools. $0.001–$0.002 USDC on Base. No API keys.","url":"https://agent402.co.uk/v1/utils/token-amount","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"amount":{"type":"string","description":"Amount string"},"decimals":{"type":"string","description":"0-36"},"direction":{"type":"string","description":"to_atomic | to_human"}}},"responseSchema":{"type":"json","example":{"valid":true,"result":"1500000"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_leSInE7VpsKc6PXyKMnQ0","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Converts ERC-20-style token amounts between human-readable and atomic (wei-style) units for any decimal precision from 0 to 36.","exampleAgentPrompt":"Convert 1.5 USDC to atomic units — USDC has 6 decimals, so scale it to_atomic for me so I can pass it directly to a smart contract.","exampleUseCases":[{"title":"Preparing ERC-20 transfer payload","prompt":"I need to send 250 USDT (6 decimals) in a smart contract call — can you convert that to atomic units so I have the raw integer to pass in?"},{"title":"Displaying DeFi balance to user","prompt":"The contract returned 1500000000000000000 as a raw balance for an 18-decimal token — convert that from atomic to human-readable so I can show it nicely in the UI."},{"title":"Cross-token swap amount normalisation","prompt":"I'm building a Uniswap swap and need to normalise 0.005 WBTC (8 decimals) into its atomic form — can you give me the exact integer amount?"}],"resultDescription":"Returns a JSON object with a boolean 'valid' field indicating whether the inputs were acceptable, and a 'result' string containing the converted amount (e.g. '1500000'). The result is always a string to preserve large integer precision.","failureModes":["Invalid decimals value outside 0–36 range returns valid:false","Non-numeric or malformed amount string returns valid:false","Invalid direction value (not 'to_atomic' or 'to_human') causes rejection","Negative amount strings may be rejected depending on implementation","Network timeout or payment failure returns HTTP 402 or 5xx"],"whenToPreferThis":"Use this endpoint when an AI agent needs to programmatically convert token amounts between human-readable and raw atomic representations for any ERC-20-compatible token with arbitrary decimal precision (0–36). It is especially useful as glue logic inside DeFi workflows where exact integer amounts are required for on-chain calls, avoiding floating-point errors that arise from manual conversion. Prefer this over writing ad-hoc BigInt arithmetic in agent code when you need a reliable, API-accessible conversion with validation feedback.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:51:29.386Z","isFirstParty":false}