/** * MagicBlock MCP Tools * * Registers 21 MagicBlock tools across 3 protocol domains: * - mb-router (6 read-only ER Router JSON-RPC tools) * - mb-payments (13 Private Payment API REST tools, including ensure-crank) * - mb-vrf (2 Solana VRF tools — on-chain via @solana/web3.js) * * Pricing: * READ = hosted read-premium tier — lightweight discovery, quote, and state tools. * BUILD = hosted builder/value-action tiers — transaction-building or value-moving tools. * * Write tools (deposit, transfer, withdraw, swap, initializeMint) return * unsigned transactions. Agents must use sap_preview_transaction, * sap_sign_transaction, and sap_submit_signed_transaction. Do not create * temporary signing scripts or read local keypair files. */ import { Server } from '@modelcontextprotocol/sdk/server/index.js'; import type { SapMcpContext } from '../../core/src/types.js'; type SwapMode = 'ExactIn' | 'ExactOut'; export interface SwapQuoteResponse { readonly inputMint: string; readonly inAmount: string; readonly outputMint: string; readonly outAmount: string; readonly otherAmountThreshold: string; readonly swapMode: SwapMode; readonly slippageBps: number; readonly priceImpactPct: string; readonly routePlan: readonly unknown[]; readonly contextSlot: number; readonly timeTaken: number; readonly [key: string]: unknown; } /** * Sanitize a swap quote response before forwarding it to the MagicBlock swap API. * * The Metis quote API can return `routePlan[].bps: null` for some routes, while * the swap endpoint requires numeric route share basis points. Never invent a * route share: derive it from `percent`, use 10000 only for an unambiguous * single-hop route, and fail closed for ambiguous multi-hop quotes. */ export declare function sanitizeSwapQuoteResponse(quoteResponse: SwapQuoteResponse): SwapQuoteResponse; /** * @name registerMagicBlockTools * @description Registers 21 MagicBlock tools (ER Router, Private Payments, VRF) * with the MCP server. Hosted pricing is resolved centrally by src/payments/pricing.ts. * @param server - MCP server receiving tool definitions and handlers. * @param context - Shared runtime context (VRF getRandomnessResult uses the Solana connection). */ export declare function registerMagicBlockTools(server: Server, context: SapMcpContext): void; export {}; //# sourceMappingURL=magicblock-tools.d.ts.map