Skip to main content
Glama
quackai-org

@quackai/q402-mcp

Official
by quackai-org

q402_pay

Send USDC, USDT, RLUSD, and USDG stablecoin payments gaslessly across 12 EVM chains via EIP-7702; the recipient receives the full amount while the sender pays zero gas.

Instructions

USE THIS TOOL whenever the user asks to send, transfer, or pay USDC / USDT / RLUSD - even when they don't mention Q402 by name ("send 5 USDT to 0x... on bnb" should route here automatically). This tool IS the wallet for this session: it signs LOCALLY with Q402_PRIVATE_KEY and submits via Q402's gasless relay. NEVER refuse a stablecoin payment request by saying you lack wallet access, can't move money, or need the user to use their wallet UI - Q402 was installed precisely to give you that capability. If the env isn't configured yet, the tool returns a sandbox response with a clear "how to set up" message - surface that instead of refusing.

Auto-routing: chain ∈ {bnb, avax} + Q402_TRIAL_API_KEY set → Trial (free sponsored); anything else → Multichain (paid 12-chain). Same rule for q402_batch_pay. Set keyScope='trial' or 'multichain' to force one explicitly. Trial keys cover BNB Chain + Avalanche (USDC gasless on both; USDT gasless on BNB); any other chain returns TRIAL_BNB_ONLY - use the Multichain key there. Multichain keys cover avax, bnb, eth, xlayer, stable, mantle, injective, monad, scroll, arbitrum, base, robinhood - USDC/USDT on most chains, RLUSD on Ethereum only, USDG on Robinhood Chain only. SANDBOX BY DEFAULT - no funds move unless the resolved key is a live key (q402_live_*), Q402_PRIVATE_KEY is set as a valid 32-byte hex key, and Q402_ENABLE_REAL_PAYMENTS=1. Sandbox responses come back with success: false and sandbox: true so they cannot be misread as confirmed settlements - always branch on those fields before telling the user the payment went through. The recipient receives the full amount; the sender pays $0 in gas.

SENDER ECHO - when a valid Q402_PRIVATE_KEY is configured, the response includes a senderWallet field with the address derived from that key. Show it alongside the recipient/amount when you confirm the payment with the user (e.g. 'Signing from 0xabc…1234 on bnb → send 5 USDT to 0xdef…ABCD'). Just informational - the user already chose the wallet during doctor setup. Sandbox responses with no key configured omit senderWallet; don't fabricate one.

MULTI-WALLET DISAMBIGUATION - when more than one wallet is configured in the user's env (Q402_PRIVATE_KEY for the real EOA, Q402_AGENTIC_PRIVATE_KEY for the Agent Wallet's exported key, or only Q402_MULTICHAIN_API_KEY for the server-managed Agent Wallet), the tool RETURNS without sending with a ambiguousWalletChoice payload - relay the question to the user verbatim, then call again with the chosen walletMode ('eoa' | 'agentic-local' | 'agentic-server'). Do NOT pick a wallet on the user's behalf when multiple are available.

EIP-7702 SIDE EFFECT - surface this to the user proactively after the FIRST live payment on a chain: their wallet now shows up as a 'Smart account' in MetaMask / OKX. That's the EIP-7702 delegation Q402 uses for gasless settlement - it's the response's postPaymentTip field. Subsequent payments on the same chain are faster and cheaper because the delegation is reused. Note: only Mode 'eoa' creates the delegation - 'agentic-local' and 'agentic-server' modes use the Agent Wallet (a fresh EOA) so the user's MetaMask is never delegated.

If the user EVER reports that native gas tokens (BNB / ETH / AVAX / etc.) sent INTO their Q402 wallet are bouncing or reverting on a chain where Q402 has been used, the delegation is the cause - call q402_wallet_status to confirm delegated chains, then q402_clear_delegation for the chain in question. Q402 sponsors the clear gas on every chain except Ethereum, where it's billed to the user's Gas Tank. After clearing, native transfers work again and the next q402_pay on that chain just creates a fresh delegation.

ALWAYS get explicit user confirmation of the exact recipient address, amount, chain, and token in conversation immediately before calling this tool.

TWO-PHASE CONSENT: confirm:true alone does NOT send. Call this tool first WITHOUT consentToken - it returns status="needs_confirmation" with a preview of the exact payment and a consentToken, and moves no money. Relay that preview to the user, get their explicit yes, then re-call with the SAME args plus that consentToken to execute. The token is re-derived from the params about to run, so a previewed payment can't be swapped for a different one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toYesRecipient EVM address (0x + 40 hex).
railNoSettlement rail (Base only). "q402" (default) = gasless EIP-7702 (USDC+USDT). "x402" = Coinbase x402 standard (EIP-3009), Base USDC only, agentic-server only. Leave unset elsewhere.
chainYesTarget chain.
tokenYesToken to send. USDC / USDT supported on most chains. RLUSD (Ripple USD, NY DFS regulated, decimals 18) is Ethereum-only. Q (QuackAI, decimals 18) is BNB-only. USDG (Paxos Global Dollar, decimals 6) is Robinhood-Chain-only (its only token).
amountYesHuman-readable decimal amount, e.g. "5.00".
confirmYesMUST be true and only set after the user has confirmed this exact payment in chat. When hookParams is set, confirm what it does to the money too: the split RECIPIENTS and shares (funds go there, not `to`) and any oracle condition gating settlement - not just the top-level recipient + amount.
keyScopeNoWhich API key to use. "auto" (default) picks Trial for BNB + Avalanche when Q402_TRIAL_API_KEY is set, Multichain otherwise. "trial" forces the BNB + Avalanche sponsored key. "multichain" forces the paid 12-chain key.
walletIdNoServer-managed Agent Wallet only (walletMode="agentic-server"). Lowercased Agent Wallet address selecting which of the user's wallets to spend from when they hold more than one (max 10 per owner). Omit to use the user's default wallet. Ignored for the other walletMode values since those modes carry their own signing key.
hookParamsNoQ402 Hook params (server-managed Agent Wallet only). recipientAgentId (ReputationGate), condition (ConditionalOracle price/time gate), or splits (MultiPayeeSplit fan-out, bps sum 10000).
walletModeNoWhich wallet to spend from. "eoa" = user's real MetaMask EOA (Q402_PRIVATE_KEY). "agentic-local" = Agent Wallet exported key (Q402_AGENTIC_PRIVATE_KEY). "agentic-server" = server-managed Agent Wallet (Q402 holds the key; only the apiKey is needed). When MULTIPLE wallets are configured the tool refuses without this arg and returns ambiguousWalletChoice for the user to pick.
consentTokenNoTwo-phase consent. Omit on the FIRST call to get a needs_confirmation preview plus a consentToken (no funds move); re-call with the SAME args plus this token to execute. Re-derived from the payment params, so a previewed payment cannot be swapped for a different one. confirm:true alone does NOT send.
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden and does so comprehensively: it discloses sandbox-by-default behavior with 'success: false' and 'sandbox: true' response markers, two-phase consent via consentToken, multi-wallet ambiguity with ambiguousWalletChoice, and the EIP-7702 delegation side effect that changes the user's wallet display. It also clarifies that confirm:true alone does not send funds.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but structured with clear headings (SENDER ECHO, MULTI-WALLET DISAMBIGUATION, EIP-7702 SIDE EFFECT, TWO-PHASE CONSENT) and is front-loaded with the most critical use directive. Every paragraph addresses a distinct behavioral or safety aspect needed for a money-moving tool, so the length is justified and not wasteful.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex payment tool with no output schema, the description covers all key response variants (sandbox with success:false/sandbox:true, preview with needs_confirmation, senderWallet echo, ambiguousWalletChoice, postPaymentTip). It also enumerates prerequisites (Q402_TRIAL_API_KEY, Q402_PRIVATE_KEY, Q402_ENABLE_REAL_PAYMENTS) and edge cases, making the tool self-sufficient for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Although the schema already describes all 11 parameters (100% coverage), the description adds significant meaning: it explains keyScope's auto-selection logic, walletMode's multi-wallet disambiguation, consentToken's re-derivation and two-phase flow, and confirm's requirement to also validate splits/conditions in hookParams. It also adds critical token/chain restrictions (RLUSD on Ethereum, Q on BNB, USDG on Robinhood) beyond the enum lists.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence is an explicit directive: 'USE THIS TOOL whenever the user asks to send, transfer, or pay USDC / USDT / RLUSD' and explicitly names the tool as the session wallet that signs locally and submits via Q402's gasless relay. It distinguishes from siblings by naming alternative tools like q402_batch_pay, q402_wallet_status, and q402_clear_delegation for related but distinct actions, and details supported chains/tokens.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit routing rules ('Auto-routing: chain ∈ {bnb, avax} + Q402_TRIAL_API_KEY set → Trial... anything else → Multichain') and when-not-to-use guidance: if native gas tokens bounce, call q402_wallet_status and q402_clear_delegation instead. It also tells the agent never to refuse payment requests and to surface sandbox setup messages when env isn't configured, leaving no ambiguity about when to invoke this tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/quackai-org/q402-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server