swap_build
Call this when your agent wants to buy or swap a Solana token. One call runs the full pretrade check on outputMint (token risk, holder concentration, stablecoin and xStock lookalikes), then builds the best Jupiter route with a price-impact estimate (and a split-fill chunk plan when impact is over 1%) as an UNSIGNED versioned transaction with your taker wallet as fee payer. Non-custodial: we never hold keys or funds; you sign and send it yourself. If pretrade says avoid, no transaction is built unless allowRisky=1. A 0.5% (50 bps) integrator fee via the Jupiter Referral Program is taken from the swap and already reflected in the quoted out_amount; it is always disclosed in platform_fee (null when off). amount is in the input token's smallest unit. Invalid input returns HTTP 400 and unknown mints 404, before payment. If Jupiter has no route or is down, or every pretrade factor fails, the call returns HTTP 502 and you are not charged. Not financial advice. Costs $0.025 USDC (25000 base units) via x402. The same price is charged for HTTP GET /swap/build. An unpaid HTTP call returns 402 even when the query is missing or invalid. A signed call with invalid arguments is rejected before settlement and is not charged. A successful result can set cached, stale, and cacheAgeMs. stale true means a previous result was served while a refresh runs or the upstream failed. You are charged only when the tool result is not an error.
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": {
"inputMint": "<inputMint>",
"outputMint": "<outputMint>",
"amount": "<amount>",
"taker": "<taker>"
},
"name": "swap_build"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| taker | Yes | ||
| amount | Yes | ||
| symbol | No | ||
| inputMint | Yes | ||
| allowRisky | No | ||
| outputMint | Yes | ||
| slippageBps | No |