{"name":"build_tx","title":"Build it, checked","category":"transactions","useWhen":"Run when an agent needs to send SOL or a token, or swap through Jupiter: it returns the unsigned transaction already checked, with ready_to_sign and the reasons. Sign only when ready_to_sign is true.","benefit":{"kind":"money","text":"An agent that builds its own transactions can get the token, amount, decimals or recipient wrong. This builds exactly what was asked, then refuses to call it ready unless check_tx says OK and tx_matches says MATCH."},"description":"Builds a SOL or token transfer, or a Jupiter swap, as an unsigned transaction with a fresh blockhash and a fair priority fee, then runs check_tx and tx_matches on it (and token_safety on a token being bought). Never signs or sends.","price":"$0.03","priceText":"25 free calls a day, then $0.03 USDC per call (x402)","http":{"method":"POST","path":"/api/tools/build_tx","body":"JSON object with the inputs below"},"mcp":{"method":"tools/call","name":"build_tx"},"inputs":[{"name":"action","type":"\"transfer\" | \"swap\"","required":true,"lookingFor":"Send a token to someone, or swap one token for another through Jupiter.","whereToGet":"From the request."},{"name":"from","type":"string (base58 address)","required":true,"lookingFor":"The wallet that pays and will sign.","whereToGet":"The agent's or user's own wallet address."},{"name":"to","type":"string (base58 address)","required":false,"lookingFor":"Transfers: who receives it.","whereToGet":"From the request. Check it with whats_this first if it came from someone else."},{"name":"token","type":"string (\"SOL\" or mint address)","required":false,"lookingFor":"The token to send (transfer) or to sell (swap). Default \"SOL\".","whereToGet":"find_token turns a name like USDC into its mint address. Never guess a mint."},{"name":"amount","type":"string (decimal)","required":true,"lookingFor":"How much of token, in whole tokens: \"1.5\" means 1.5 USDC, not raw units.","whereToGet":"From the request."},{"name":"buy","type":"string (\"SOL\" or mint address)","required":false,"lookingFor":"Swaps: the token to buy.","whereToGet":"find_token gives the mint."},{"name":"slippage_bps","type":"integer 1-300","required":false,"lookingFor":"Swaps: the most the price may move against you, in basis points (50 = 0.5%). Default 50, at most 300.","whereToGet":"Leave the default unless the token is thinly traded."},{"name":"allow_avoid","type":"boolean","required":false,"lookingFor":"Swaps: build even when token_safety says AVOID for the token being bought. Default false.","whereToGet":"Only when the user has read the AVOID reasons and still wants it."},{"name":"network","type":"\"mainnet-beta\" | \"devnet\"","required":false,"lookingFor":"Default \"mainnet-beta\" (real money).","whereToGet":"\"devnet\" only for test wallets."}],"outputs":[{"field":"ready_to_sign","type":"boolean","is":"True only when every check below passed. Sign only then.","howWorkedOut":"check_tx OK, tx_matches MATCH, and for a swap the bought token isn't AVOID (unless allow_avoid)."},{"field":"summary","type":"string","is":"What the transaction does and whether it's ready, in one or two sentences.","howWorkedOut":"From the request and the checks."},{"field":"tx","type":"string (base64)","is":"The unsigned transaction (version 0). Sign it with the from wallet and send it within about a minute, before the blockhash expires.","howWorkedOut":"Transfers built here (Compute Budget, then the transfer; token transfers create the recipient's account if needed). Swaps built by Jupiter's swap API."},{"field":"reasons[]","type":"string[]","is":"Why it isn't ready, in plain words. Empty when ready_to_sign is true.","howWorkedOut":"The failing checks' own summaries."},{"field":"checks","type":"object","is":"The full answers: check_tx (verdict, summary, checks, balance_changes), tx_matches (verdict, summary, compared), and token_safety for a swap's bought token.","howWorkedOut":"The same tools, run on the built transaction."},{"field":"quote","type":"object | null","is":"Swaps: in_amount, out_amount and min_out_amount in raw units, price_impact_pct and slippage_bps.","howWorkedOut":"Jupiter's quote that the transaction was built from."}],"notes":["Never signs or sends. The from wallet signs; keys never reach Pulse.","A blockhash lasts about a minute: sign and send soon, or build again.","The checks run on the transaction as built. If anything changes it afterwards, check it again."],"inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"action":{"type":"string","enum":["transfer","swap"],"description":"Send a token to someone, or swap one token for another through Jupiter. From the request."},"from":{"type":"string","description":"The wallet that pays and will sign. The agent's or user's own wallet address."},"to":{"description":"Transfers: who receives it. From the request. Check it with whats_this first if it came from someone else.","type":"string"},"token":{"default":"SOL","description":"The token to send (transfer) or to sell (swap). Default \"SOL\". find_token turns a name like USDC into its mint address. Never guess a mint.","type":"string"},"amount":{"type":"string","pattern":"^\\d+(\\.\\d+)?$","description":"How much of token, in whole tokens: \"1.5\" means 1.5 USDC, not raw units. From the request."},"buy":{"description":"Swaps: the token to buy. find_token gives the mint.","type":"string"},"slippage_bps":{"default":50,"description":"Swaps: the most the price may move against you, in basis points (50 = 0.5%). Default 50, at most 300. Leave the default unless the token is thinly traded.","type":"integer","minimum":1,"maximum":300},"allow_avoid":{"default":false,"description":"Swaps: build even when token_safety says AVOID for the token being bought. Default false. Only when the user has read the AVOID reasons and still wants it.","type":"boolean"},"network":{"default":"mainnet-beta","description":"Default \"mainnet-beta\" (real money). \"devnet\" only for test wallets.","type":"string","enum":["mainnet-beta","devnet"]}},"required":["action","from","amount"]}}