Glitter Agent Gate
Provides XRPL data tools for querying account balances, reserves, spendable amounts, trust lines, recent transactions, token issuer/supply/AMM price information, and price data on XRP Ledger mainnet or testnet; also supports XRP/RLUSD payments over x402 on XRPL.
Glitter Agent Gate — x402 pay-per-call tools for AI agents
Live on mainnet: https://agents.glitterchainscout.trade (deployed 17 Nov 2026)
"The plumbing agents pay for": a Cloudflare Worker that sells small, useful tool endpoints to AI agents, paid per call with x402 on the XRP Ledger in XRP or RLUSD (via the t54 facilitator). It can also offer USDC on Base as a second option in the same 402 so EVM-only buyers and the Coinbase/PayAI Bazaar indexes can find it. A secondary marketplace lets other providers list their own APIs and get paid directly.
Status: live on XRPL mainnet + Base at https://agents.glitterchainscout.trade (
[env.production]), listed on the XRPL AI Hub. Validated end to end on XRPL testnet (xrpl:1); no mainnet payment has been made yet. Local dev stays on testnet. Real testnet settlements: seee2e/RESULTS.md.
What it sells (v1)
Slug | What | Price (XRP / RLUSD / USDC) | Johnny's range |
| Public web page → clean Markdown (Readability). Honors robots.txt. No captcha/paywall/bot-protection bypass; blocked pages return an error and are not charged. | 0.020436 / 0.02 / 0.02 | $0.01–0.03 |
|
| 0.002044 / 0.002 / 0.002 | $0.001–0.005 |
| PDF / CSV / TSV / XLSX / HTML → JSON or text. Raw bytes, or JSON | 0.051089 / 0.05 / 0.05 | $0.02–0.10 |
| Safe deterministic JSON ops (pick, flatten, sort_by, dedupe, to_csv…). No eval, no user regex. | 0.005109 / 0.005 / 0.005 | ~$0.005 (sandbox slot) |
| Smallest paid call, for testing clients. | 0.0001 / 0.0001 / 0.001 | — |
XRP prices use US$0.9787/XRP (CoinGecko + Kraken live, 17 Nov 2026 23:55 ET), rounded up to whole drops. They are static in src/catalog.ts; re-check if XRP moves a lot.
A code sandbox is intentionally not in v1 (security risk). Later option: a locked-down sandbox on a separate Worker.
Related MCP server: @warppay402/warppay402-mcp-tools
Architecture
agent ──GET /s/xrpl-data/account?address=r…──▶ Worker (src/index.ts)
◀── 402 + PAYMENT-REQUIRED (accepts: XRP, RLUSD on xrpl:1 [+ USDC on Base]) + bazaar extension
agent signs XRPL Payment (x402-xrpl SDK, invoice-bound, SourceTag 804681468)
──retry with PAYMENT-SIGNATURE──▶ Worker
1. look up invoice in D1, match the exact option (amount/asset/payTo/invoiceId)
2. POST facilitator /verify (t54 for xrpl:*, PayAI for eip155:*)
3. claim invoice atomically (no double use)
4. run the tool (or proxy to a listed provider's upstream)
└ tool failed → invoice re-opens, nothing settled, X-402-Charged: false
5. POST facilitator /settle → tx hash
└ settle failed → result withheld (never given away free)
6. record settlement in D1 → 200 + result + PAYMENT-RESPONSENon-custodial. Buyers pay the service's
payTodirectly on-ledger. The facilitator only submits the buyer-signed blob. The gateway never holds keys or funds.Storage: D1 (
invoices,settlements,call_log,providers,listed_services). Schema:migrations/0001_init.sql.Safety rails: mainnet refused unless
ALLOW_MAINNET="true"; inputs validated before the 402 so nobody pays for a bad request; replay/underpayment/cross-service invoice reuse rejected (e2e/security-tests.ts); SSRF guard on user URLs; size caps; robots.txt.
Files
src/index.tsrouter ·src/x402.ts402/verify/settle logic + Bazaar extension ·src/catalog.tsown services and pricessrc/services/*tool implementations ·src/registry.tsmarketplace listings + proxy ·src/discovery.tsmanifests ·src/dashboard.tsclients/ts/agent-demo.tsXRPL agent client ·clients/ts/agent-demo-base.tsBase USDC client ·mcp/MCP server +server.jsone2e/results, security tests, tx verifier ·examples/upstream-provider.mjssample listed provider ·scripts/testnet wallet setupLISTING.mdwhere to register once live ·BUSINESS.mdhow it could earn, honestly
Discovery endpoints (all free)
Path | What |
| JSON catalog for agents (prices, endpoints, params, examples) |
| x402 v2 spec §8.1 Bazaar-format listing ( |
| Fan-out catalog (URL list, x402scan format) — crawled hourly by the XRPL AI Hub once registered |
| A2A v1.0 Agent Card; |
| OpenAPI 3.1 with |
| Plain-text guide for LLMs |
| Binds the domain to the payout wallet (t54 Trustline standing) |
| Calls, revenue per service and per provider (production fails closed with 503 until the |
Every 402 also carries the official bazaar extension (generated with @x402/extensions/bazaar declareDiscoveryExtension).
Run the demo locally (testnet)
cd /workspace/x402-gateway
npm install
npm run wallets # creates + faucet-funds testnet wallets -> .secrets/testnet-wallets.json (chmod 600)
npm run rlusd # trust lines + buys 2 test RLUSD from the testnet XRP/RLUSD AMM
npm run db:migrate
npm run dev # http://127.0.0.1:8787 (optional: --var BASE_PAY_TO:0x… to show the Base rail)
npm run demo -- --service hello --query name=johnny
npm run demo -- --service xrpl-data --path /account --query "address=rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De" --asset RLUSD
npm run demo -- --service web-markdown --query "url=https://xrpl.org/docs/agents/agentic-payments-x402"
npm run demo -- --service convert --method POST --file e2e/fixtures/sample.pdf --content-type application/pdf
npm run test:security # replay / underpayment / cross-service reuse
npm run test:mcp # MCP server over stdio, one paid call
npm run verify:txs # re-checks every logged tx on the testnet ledger -> e2e/RESULTS.mdOpen http://127.0.0.1:8787/dashboard for calls and revenue.
How an agent pays
Use any x402 v2 client. For XRPL: npm i x402-xrpl (or pip install x402-xrpl) and wrap fetch:
import { x402Fetch } from "x402-xrpl"; import { Wallet } from "xrpl";
const paid = x402Fetch({ wallet: Wallet.fromSeed(process.env.XRPL_SEED!), network: "xrpl:0" }); // "xrpl:1" + http://127.0.0.1:8787 for local testnet
const r = await paid("https://agents.glitterchainscout.trade/s/xrpl-data/prices?ids=ripple"); // production = xrpl:0The SDK picks an option, signs an invoice-bound XRPL Payment, retries with PAYMENT-SIGNATURE, and the gateway returns PAYMENT-RESPONSE ({success, transaction, network, payer}).
Claude/other MCP clients: see mcp/README.md (per-call and per-session spend caps built in).
How a provider lists a service (secondary marketplace)
curl -X POST https://agents.glitterchainscout.trade/api/services -H "authorization: Bearer $REGISTRY_ADMIN_TOKEN" -H 'content-type: application/json' -d '{
"slug":"my-weather","name":"Weather","description":"…","upstream_url":"https://api.example.com/weather",
"price_xrp":"0.001","price_rlusd":"0.001","pay_to":"rYourXRPLAddress","tags":["weather"]}'Returns a providerKey (manage/deactivate) and an upstreamSecret; the upstream receives X-Gateway-Secret on every paid call and
should reject anything else. REGISTRATION_MODE = admin (default) | open | closed. Buyers pay pay_to directly.
Platform fee trade-off. x402 exact is one payment to one payTo, so a fee can't be split on-ledger without custody. Options:
v1 default: fee 0%. Pay provider directly. Simplest and fully non-custodial.
Fee ledger (implemented): set
PLATFORM_FEE_BPS(e.g.100= 1%). Each settlement recordsfee_owed; bill providers later. Non-custodial, but needs trust/collection.Custodial: gateway is
payTo, then pays providers out. Easy fee capture, but holding others' money brings money-transmission/compliance risk. Not built. Listing fees or a premium placement in/servicesare the other non-custodial routes.
Configs
Default ( |
| |
Worker |
|
|
URL | https://agents.glitterchainscout.trade (Custom Domain, created on deploy) | |
XRPL |
|
|
XRP/RLUSD payTo | testnet wallet |
|
Base USDC | Base Sepolia | Base |
Fee / registration | 0% / admin | 0% / admin |
Dashboard | open locally | needs |
D1 |
|
|
Deploying production
Box wrangler auth is broken (the injected API token returns 401), so production was deployed through the Cloudflare API (MCP execute):
npx wrangler deploy --dry-run --env production --minify --outdir /tmp/bundle-prodpython3 scripts/build-cf-deploy-payload.py→ writes.secrets/deploy-code.js(contains secrets, chmod 600, delete after use)Run that file as the Cloudflare MCP
executecode (PUT /accounts/{id}/workers/scripts/glitter-agent-gate). With working wrangler auth instead:npx wrangler deploy --env production(secrets viawrangler secret put … --env production). New migrations: apply viawrangler d1 migrations apply glitter-agent-gate --env production --remote(thed1_migrationstable is in sync). Custom domainagents.glitterchainscout.trade→glitter-agent-gateis attached;workers.devis disabled.
Costs
Cloudflare: Workers Free = 100k requests/day but only 10 ms CPU per request.
xrpl-data,json-toolsandhelloare I/O-bound and fit.web-markdown(DOM parsing) andconvert(PDF/XLSX) can exceed 10 ms on big inputs, so plan on Workers Paid ($5/month minimum) once those get traffic. D1 free tier (5M row reads, 100k row writes/day) is plenty. Bundle ≈ 1.1 MB gzipped (under the 3 MB free limit). Check Cloudflare's pricing page before launch, these numbers can change.XRPL: the buyer pays the network fee (~0.00001 XRP). Receiving costs nothing. An RLUSD trust line locks a 0.2 XRP owner reserve.
Facilitators: t54 hosted: I found no published fee (confirm at support@t54.ai). PayAI: no API key needed. CDP: 1,000 tx/month free, then $0.001/tx, and it needs CDP API keys.
Upstream data: CoinGecko's public API is rate-limited and has its own terms. For commercial volume, budget for a paid key or switch sources (on-ledger AMM prices are free).
Available Tools
7 toolscall_paid_serviceA
Generic caller for any Glitter Agent Gate endpoint (own tools or listed providers) by service slug and sub-path. Returns {status, http, result, payment:{asset, amount, tx, explorer}}. Paid per call with x402 from your XRPL_SEED wallet (XRP or RLUSD, capped by MAX_*PER_CALL and SESSION_BUDGET*). Without a wallet it returns the price quote and charges nothing. Failed calls are not charged.
Inputs: service (required), body, path, asset, +2 more.
convert_fileA
Download a public PDF, CSV/TSV, XLSX/XLS or HTML file (max 10 MB) and convert it to structured JSON (rows, sheets, pages) or plain text. Price about $0.05. Paid per call with x402 from your XRPL_SEED wallet (XRP or RLUSD, capped by MAX_*PER_CALL and SESSION_BUDGET*). Without a wallet it returns the price quote and charges nothing. Failed calls are not charged.
Inputs: url (required), to, asset, format.
crypto_pricesA
Get spot prices for comma-separated CoinGecko ids (default ripple,ripple-usd) in a quote currency (default usd). Price about $0.002. Paid per call with x402 from your XRPL_SEED wallet (XRP or RLUSD, capped by MAX_*PER_CALL and SESSION_BUDGET*). Without a wallet it returns the price quote and charges nothing. Failed calls are not charged.
Inputs: vs, ids, asset.
json_transformA
Apply a pipeline of deterministic JSON operations (pick, get, flatten, filter_eq, sort_by, dedupe, limit, count, keys, to_csv) to the given data. No code execution or regex. Price about $0.005. Paid per call with x402 from your XRPL_SEED wallet (XRP or RLUSD, capped by MAX_*PER_CALL and SESSION_BUDGET*). Without a wallet it returns the price quote and charges nothing. Failed calls are not charged.
Inputs: ops (required), data (required), asset.
list_servicesARead-only
List every Glitter Agent Gate tool with its endpoints, parameters, examples and per-call prices in XRP, RLUSD and USDC. Free: makes no payment and needs no wallet. Use this first to pick a service slug for call_paid_service.
Inputs: no named parameters.
web_to_markdownA
Fetch one public web page and return clean Markdown plus title, byline and word count (Readability extraction; mode=full keeps the whole body). Honors robots.txt and never bypasses logins, paywalls or captchas; blocked pages return an error. Price about $0.02. Paid per call with x402 from your XRPL_SEED wallet (XRP or RLUSD, capped by MAX_*PER_CALL and SESSION_BUDGET*). Without a wallet it returns the price quote and charges nothing. Failed calls are not charged.
Inputs: url (required), mode, asset.
xrpl_account_infoA
Summarize an XRP Ledger account: XRP balance, reserve, spendable amount, trust lines (e.g. RLUSD) and the last 10 transactions, from mainnet (default) or testnet. Price about $0.002. Paid per call with x402 from your XRPL_SEED wallet (XRP or RLUSD, capped by MAX_*PER_CALL and SESSION_BUDGET*). Without a wallet it returns the price quote and charges nothing. Failed calls are not charged.
Inputs: address (required), asset, network.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each specialized tool targets a distinct capability (web scraping, XRPL account info, crypto prices, file conversion, JSON transforms), but call_paid_service is a generic caller that can invoke any of those same endpoints, creating a structural overlap between it and every other paid tool. The descriptions mitigate this by framing list_services as the discovery step and call_paid_service as the escape hatch for providers not exposed as native tools, but an agent could still reasonably pick either path for e.g. web_to_markdown.
All names are consistently snake_case and mostly verb_noun (list_services, call_paid_service, convert_file, json_transform) or descriptive noun phrases (web_to_markdown, xrpl_account_info, crypto_prices). The mix of action-first and resource-first forms is a minor deviation but everything remains immediately readable.
Seven tools is well-scoped for a paid API gateway: one free discovery tool, one generic caller, and five distinct paid capabilities. Each tool earns its place without obvious redundancy or bloat.
Discovery (list_services), execution (call_paid_service), and a solid spread of concrete services cover the gateway's core purpose, and the generic caller makes the surface open-ended for unlisted providers. Minor gaps exist around self-introspection, such as a tool to check wallet balance, remaining session budget, or payment history before spending.
Maintenance
Related MCP Connectors
Pay-per-call tools for AI agents: product photos, documents, web pages, data. USDC via x402.
Pay-per-call MCP tools for agents via x402 USDC: Korean data, onchain, crypto, web and AI tools.
Pay-per-call web tools for agents (extract, summarize, ask, JSON) via x402 USDC on Base.
Pay-per-call PDF to text, RSS/Atom to JSON, sitemap to URLs for agents. x402 USDC, Base/Algorand.
Related MCP Servers
AlicenseNot gradedqualityDmaintenanceProvides 20+ AI agent capabilities like web scraping, PDF parsing, OCR, and more, with pay-per-use micropayments via x402.1MIT- AlicenseNot gradedqualityCmaintenanceEnables AI agents to use pay-per-use web scraping, Base blockchain analytics, and PDF text extraction tools, monetized via x402 USDC micropayments.MIT
- AlicenseAqualityCmaintenanceEnables agents to call paid utilities for DNS/SSL checks, site status, summarization, keyphrase extraction, decision advice, data cleanup, claim verification, and grounding via per-call USDC payments over x402, with free discovery tools and no signup or API key.10MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to call pay-per-request AI and web tools—including web-to-Markdown reading, PDF extraction, translation, compliance lookups, domain/email/Solana data, and prediction-market intelligence—without accounts or API keys, settling each call in USDC via x402 on Base, Solana, or Arc.MIT