magicblock requestRandomness
magicblock_requestRandomnessRequest provably fair on-chain randomness from the MagicBlock VRF oracle (Vrf1RNUjXmQGjmQrQLvJHs9SNkvDJEsRVFPkfSQUwGz). Builds an unsigned transaction that invokes request_randomness on the VRF program. Use sap_preview_transaction, sap_sign_transaction, and sap_submit_signed_transaction; do not create local signing scripts. The oracle queue defaults to the base-layer queue (Cuj97ggrhhidhbu39TijNVqE74xvKJ69gDervRUXAxGh); set ephemeral=true to use the ER queue for delegated programs. Builder fee applies.
SAP MCP execution guidance: Intent: SAP MCP tool workflow. Pricing: paid builder; estimate first, then pay/build and finalize unsigned transactions locally when returned. 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.
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": {
"payer": "<payer>",
"callbackProgramId": "<callbackProgramId>",
"callbackDiscriminator": "<callbackDiscriminator>",
"callerSeed": "<callerSeed>",
"callbackAccounts": "<callbackAccounts>"
},
"name": "magicblock_requestRandomness"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| payer | Yes | Wallet pubkey that will pay for the request and sign the transaction | |
| endpoint | No | MagicBlock Router endpoint: 'mainnet' or 'devnet' | |
| ephemeral | No | Use the Ephemeral Rollup oracle queue instead of the base-layer queue (default false) | |
| callerSeed | Yes | Seed string for the VRF request — committed before randomness is produced. The seed is hashed to 32 bytes. | |
| callbackAccounts | Yes | Accounts to pass to the callback instruction | |
| callbackProgramId | Yes | Program ID of the callback program (the program that will consume the randomness) | |
| callbackDiscriminator | Yes | Base58 or hex discriminator for the callback instruction in your program |
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. |