magicblock swap
magicblock_swapConstructs an unsigned swap transaction from a quote, with public Jupiter routing or private scheduled transfer with configurable delay and split.
Instructions
Build an unsigned swap transaction from a quote. 'public' mode passes through Jupiter. 'private' mode routes output through scheduled private transfer with delay and split, requires destination, and currently rejects wSOL output because live mainnet testing found stuck-fund risk in MagicBlock shuttle delivery. 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.
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. |