magicblock swap
magicblock_swapBuild an unsigned swap transaction from a quote. 'public' mode passes through Jupiter. 'private' mode routes output through a scheduled private transfer: requires destination, minDelayMs (string ms), maxDelayMs (string ms, <= 600000), and split (1-14). The API appends a schedule_private_transfer instruction that registers a one-shot Hydra crank for delivery. Legacy transactions are not allowed in private mode. Agents must continue with sap_preview_transaction, sap_sign_transaction, and sap_submit_signed_transaction; never write temporary signing scripts or read keypair JSON. Value-action fee applies.
SAP MCP execution guidance: Intent: Solana value-action or trading workflow. Pricing: paid value-action; preview cost and transaction effects before user confirmation. Routing: paid hosted call; call sap_estimate_tool_cost first, then use sap_payments_call_paid_tool if the runtime cannot handle x402 natively. Signer boundary: hosted reads/builders never receive keypair bytes; value-moving results must be finalized locally when signing is required.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| split | No | Private only. Number of queue entries to split across (1-14) | |
| validator | No | Optional validator pubkey for the transfer-queue PDA | |
| maxDelayMs | No | Private only. Latest (ms) the queued transfer may settle (<= 600000) | |
| minDelayMs | No | Private only. Earliest (ms) the queued transfer may settle | |
| visibility | No | 'public' = transparent Jupiter pass-through, 'private' = output routed through scheduled private transfer | |
| clientRefId | No | Private only. Optional u64 client correlation ID | |
| destination | No | Final private-transfer recipient (required when visibility='private') | |
| quoteResponse | Yes | Quote response object from magicblock_swapQuote (pass as-is) | |
| userPublicKey | Yes | Wallet that will sign the swap transaction | |
| wrapAndUnwrapSol | No | Auto wrap/unwrap native SOL when needed (default true) | |
| asLegacyTransaction | No | Build a legacy transaction (not allowed when visibility=private, default false) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | MCP content blocks returned to the caller. | |
| isError | No | True when the tool result represents an application-level error. |