Polygon x402 AI Data Agent
This server enables AI agents to autonomously purchase and retrieve clean, AI-ready web data on Polygon via HTTP 402 micropayments.
Get payment info: Retrieve pricing tiers and recipient address for micropayments.
Fetch clean web content: Extract AI-ready Markdown from any webpage (0.01 USDC).
Fetch YouTube transcript: Get full transcripts with timestamps in Markdown (0.02 USDC, optional language).
Fetch PDF markdown: Convert PDF research papers and reports into structured Markdown (0.05 USDC).
Fetch plain text: Extract lightweight raw text for fast indexing (0.005 USDC).
Each tool requires a payment transaction hash as proof of payment, enabling fully machine-to-machine transactions without sign-ups or API keys.
โก The Spend Firewall & B2A Autonomous Agent Data Oracle (CleanWeb Studio v2.4.0)
"The Spend Firewall for Autonomous Agents: Verified data in. Signed policy out. Every payment auditable on-chain."
Zero credit cards. Zero human logins. 100% Native USDC micropayments & pre-funded vaults with on-chain EIP-712 spend policy attestations.
๐ Why CleanWeb Studio for Autonomous AI Agents?
Autonomous AI Agents (LangChain, CrewAI, AutoGPT, DeFi trading bots) face three critical bottlenecks when accessing web knowledge:
Paywall & Anti-Bot Friction: Agents cannot solve Cloudflare turnstiles or register credit cards.
LLM Context Token Waste: Raw HTML is 95% garbage (ads, scripts, cookie banners) that drains inference budgets.
Lack of Verifiable Truth (On-Chain Grounding): Smart contracts on Polymarket, Hyperliquid, or DeFi cannot verify whether off-chain web data has been tampered with.
CleanWeb Studio v2.4.0 solves all three in a single HTTP call.
Related MCP server: mercury-x402-mcp
๐ฎ 4 Core Agent Services & Micro-Pricing (USDC)
Service Endpoint | What it Does | Cost (USDC) | Gas Overhead |
๐ Clean Web ( | 99.9% token reduction web markdown cleaner | 0.001 USDC | 0์ (<5ms) |
๐ฌ YouTube AI ( | Gemini 3.6 Flash hybrid video analysis & audio intelligence | 0.010 USDC | 0์ (<5ms) |
๐ PDF Research ( | Formula & table-preserved academic paper extractor | 0.005 USDC | 0์ (<5ms) |
๐ฎ Web3 Signed Oracle ( | Real-time search + Clean-to-JSON + EIP-712 On-Chain Attestation | 0.035 USDC | 0์ (<5ms) |
๐ผ B2A Pre-funded Smart Vault (2.0 ~ 1,000.0 USDC)
Forget credit card chargebacks and 2.9% + $0.30 payment gateway fees. CleanWeb operates entirely on Native USDC across Polygon, Base, and Arbitrum.
Minimum Deposit:
2.0 USDC(~2,000 web cleans or 200 YouTube AI analyses)Maximum Deposit:
1,000.0 USDC(1,000,000 queries for enterprise agent clusters)Session Key Auth: Agents deposit once on-chain and receive an
X-Vault-Keyfor instant sub-5ms calls with zero gas transaction friction.
๐ฎ Oracle-Grade Grounding Pipeline (/api/v1/oracle/grounding)
graph LR
Agent[๐ค Autonomous AI Agent] -->|POST /api/v1/oracle/grounding\nQuery: Fed Interest Rate Decision| CleanWeb[CleanWeb Engine]
CleanWeb -->|1. Real-time Meta Search| Web[(Live Web Sources)]
CleanWeb -->|2. Gemini 3.6 Flash| JSON[(Structured JSON)]
CleanWeb -->|3. EIP-712 Master Key| Signer[(Cryptographic Signer)]
Signer -->|Signed Attestation v,r,s| Agent
Agent -->|ecrecover()| Contract[DeFi / Polymarket Smart Contract]1-Line Solidity Verification (CleanWebOracleVerifier.sol)
// Verify CleanWeb Oracle attestation on Polygon / Base / Arbitrum
require(
verifier.verifyAttestation(query, dataHash, timestamp, v, r, s),
"Tampered or unauthorized oracle data"
);๐ ๏ธ Quickstart (Autonomous Python Agent)
import requests
# 1. Deposit into vault via Web3 or use existing session key
VAULT_KEY = "vault_key_your_prefunded_agent_key"
# 2. Call Web3 Signed Oracle Grounding
response = requests.post(
"http://127.0.0.1:8000/api/v1/oracle/grounding",
headers={"X-Vault-Key": VAULT_KEY},
json={
"query": "US Federal Reserve interest rate decision latest",
"max_sources": 3
}
)
data = response.json()
print("Fact Summary:", data["summary_markdown"])
print("Structured JSON:", data["structured_data"])
print("EIP-712 Signature:", data["oracle_attestation"]["signature"])๐งช Comprehensive Test Suite (19/19 Passed)
# Run complete test suite
python -m pytest tests/ -vtests/test_oracle_grounding.py::test_oracle_grounding_402_challenge PASSED [ 5%]
tests/test_oracle_grounding.py::test_oracle_grounding_execution_with_attestation PASSED [ 10%]
tests/test_oracle_grounding.py::test_oracle_vault_deduction_0_035 PASSED [ 15%]
tests/test_payment_comprehensive.py::test_full_payment_lifecycle PASSED [ 21%]
tests/test_payment_comprehensive.py::test_vip_promo_code PASSED [ 26%]
tests/test_payment_comprehensive.py::test_b2a_vault_deposit_limits_lifecycle PASSED [ 31%]
tests/test_payment_comprehensive.py::test_ui_html_payment_components PASSED [ 36%]
tests/test_phase1_cleaners.py::test_web_cleaner_example_domain PASSED [ 42%]
tests/test_phase1_cleaners.py::test_youtube_cleaner_video_id PASSED [ 47%]
tests/test_phase1_cleaners.py::test_youtube_cleaner_execution PASSED [ 52%]
tests/test_phase1_cleaners.py::test_batch_clean_concurrent PASSED [ 57%]
tests/test_phase2_payments.py::test_multi_chain_configs PASSED [ 63%]
tests/test_phase2_payments.py::test_onchain_eip712_attestation PASSED [ 68%]
tests/test_phase2_payments.py::test_vault_deposit_and_deduct PASSED [ 73%]
tests/test_phase2_payments.py::test_402_challenge_returned_when_unauthorized PASSED [ 78%]
tests/test_phase2_payments.py::test_dev_bypass PASSED [ 84%]
tests/test_treasury.py::test_ping_keepalive PASSED [ 89%]
tests/test_treasury.py::test_treasury_status_endpoint PASSED [ 94%]
tests/test_treasury.py::test_multi_chain_balances_structure PASSED [100%]
======================= 19 passed, 2 warnings in 44.01s =======================๐ License
Distributed under the MIT License. See LICENSE for more information.
Available Tools
5 toolsclean_pdf_researchB
Parses and extracts structured plain text and metadata from online PDF whitepapers and academic research papers.
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | ||
| max_pages | No | ||
| auth_token_or_tx | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It only restates the core parse/extract behavior and omits important traits such as how max_pages is applied, whether auth_token_or_tx is required for paywalled papers, or what happens with malformed or non-PDF URLs.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
One compact sentence with no filler, and the key resource is front-loaded. Minor redundancy in 'Parses and extracts' and the lack of any parameter-level context keep it from being a perfect 5.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The output schema exists, so return values need not be described, but the tool involves three parameters including an optional auth token and page limit. The description does not address when or why those are used, and with no annotations to fill the gap, an agent is left under-equipped for non-trivial calls.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It adds no detail for max_pages or auth_token_or_tx, and only weakly clarifies url by implying it should point to online PDFs. The required parameter is inferable, but the optional parameters remain unexplained.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific action ('Parses and extracts'), defines the input resource ('online PDF whitepapers and academic research papers'), and specifies the output ('structured plain text and metadata'). This clearly differentiates it from sibling tools like clean_web_content and clean_youtube_transcript, which target other media types.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies the tool is for PDF-based research content but does not explicitly say when to prefer it over alternatives such as clean_web_content or clean_youtube_transcript, nor does it state any exclusions. An agent must infer usage from the resource type rather than being guided to the right choice.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
clean_web_contentA
Scrapes and converts any raw web page into clean, LLM-ready markdown, eliminating ads, navbars, and noise.
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | ||
| auth_token_or_tx | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full behavioral burden. It discloses that content is scraped, converted to markdown, and cleansed of ads/navbars/noise, which is useful. However, it does not mention authentication requirements, dynamic/JavaScript-rendered pages, rate limits, or failure behavior, especially given the unexplained auth_token_or_tx parameter.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single efficient sentence with no filler. The action and output format are front-loaded, and the noise-removal detail earns its place by clarifying what 'clean' means.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return-value details do not need to be in the description. The main gap is the unexplained auth_token_or_tx parameter and the overbroad claim of 'any raw web page' when authenticated or dynamically rendered pages may behave differently. Still, for a straightforward public-page scraper, the description is mostly adequate.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate, but it does not explain either parameter. The URL parameter can be inferred from the tool's purpose, but auth_token_or_tx is completely opaqueโwhen it is needed, what format it should take, or what 'tx' means.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states a specific action ('Scrapes and converts'), a target resource ('any raw web page'), and a concrete output ('clean, LLM-ready markdown'). It also differentiates from the sibling tools by specifying web pages rather than YouTube transcripts or PDFs.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The intended use case is implied: use this for raw web pages, while clean_youtube_transcript and clean_pdf_research serve other sources. However, there is no explicit statement about when not to use it, nor any direct comparison to alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
clean_youtube_transcriptC
Extracts high-precision subtitles, transcripts, or AI-powered comprehensive summaries for any YouTube video using Gemini AI.
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | ||
| lang | No | ko,en | |
| auth_token_or_tx | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must fully disclose behavioral traits. It mentions 'AI-powered comprehensive summaries' and 'high-precision subtitles', but does not describe potential side effects (e.g., it may call external Gemini API, may require auth, may have rate limits/delays). The description doesn't state whether this is a read-only operation or what happens with the data. This lack of disclosure leaves the agent without essential behavioral context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence, concise and front-loaded with the primary action. It avoids verbosity but doesn't offer any structural breakdown for multiple outputs (subtitles vs transcripts vs summaries) or parameter-specific details. It's efficient but minimal.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no annotations and no output schema, the description must carry substantial context. It lacks guidance on which output type to expect, how language selection works, or when the AI summary is appropriate. The tool handles several modes but the description doesn't explain how to choose among them or what the response looks like.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema covers all three parameters (url, lang, auth_token_or_tx) but with minimal descriptions. The description adds no meaning beyond what the schema provides โ it doesn't explain the `lang` default format ('ko,en') or the purpose of `auth_token_or_tx`. Since schema coverage is 100%, baseline is 3, but the description fails to enrich or clarify parameter semantics for an agent.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description specifies a clear verb ('Extracts') and a resource ('subtitles, transcripts, or AI-powered comprehensive summaries for any YouTube video'), which tells the agent what the tool operates on. It distinguishes itself from generic transcript tools by mentioning Gemini AI for high-precision output. However, the description doesn't explicitly contrast with sibling tools (none provided), so it doesn't fully separate from alternatives.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description states the general action ('Extracts ... for any YouTube video') but provides no guidance on when to use this tool versus alternatives. There are no sibling tools listed, no mention of use cases, prerequisites, or scenarios where this tool would be preferred. Without this context, an agent must infer usage from the schema alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_payment_infoA
Returns the Web3 x402 micropayment pricing, multi-chain USDC details, and vault endpoints.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the burden of behavioral disclosure. 'Returns' implies a read operation, and the listed content categories give basic insight, but there is no explicit statement about side effects, permissions, or whether this is purely non-mutating. This is adequate but not deeply transparent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence that front-loads the operation ('Returns') and then lists the specific returned data categories. Every word contributes information, with no filler or redundant phrasing.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter, read-only information tool with an output schema present, the description is largely complete: it names the three key output categories. The only gap is the potential ambiguity between 'vault endpoints' and the sibling get_vault_balance, which could have been clarified.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters and the input schema confirms an empty properties object with 100% schema description coverage. With no parameters to document, the baseline of 4 applies and the description need not add parameter detail.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Returns') and names the resource categories: Web3 x402 micropayment pricing, multi-chain USDC details, and vault endpoints. It is clearly distinguishable from the clean_* siblings, though the mention of 'vault endpoints' creates some overlap with get_vault_balance.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives no explicit guidance on when to use this tool versus alternatives. It does not mention get_vault_balance or other siblings, so an agent must infer selection entirely from the listed content categories.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_vault_balanceA
Checks the remaining pre-funded USDC balance and session status for an agent wallet address or session key.
| Name | Required | Description | Default |
|---|---|---|---|
| agent_address_or_key | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the behavioral disclosure burden. 'Checks' implies a non-mutating read, and naming balance and session status gives useful context. Still, it does not mention auth requirements, side effects, or what happens with invalid or expired addresses, so some transparency gaps remain.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single, concise sentence with the action verb front-loaded and no unnecessary detail. Every word contributes meaning and the structure is immediately scannable.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has only one parameter, no annotations, and an output schema present, the description covers the essential context. It could additionally state when to prefer this tool or clarify session status behavior, but for a simple balance/status check the description is nearly complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has 0% description coverage for the single required parameter, so the description must compensate. It clarifies that 'agent_address_or_key' can be either an agent wallet address or a session key, adding meaning beyond the parameter name. It does not provide format examples, but for one straightforward parameter this is sufficient.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states a specific verb ('Checks'), a specific resource ('remaining pre-funded USDC balance and session status'), and a target ('agent wallet address or session key'). It distinguishes the tool from sibling 'get_payment_info' by focusing on vault balance and session status rather than payment information.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The intended use is implied: it is for checking an agent's vault balance and session status. However, there is no explicit guidance about when to use this tool versus siblings, prerequisites, or conditions that would make it the right choice. For a simple read operation, this is adequate but not fully explicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
11 tool updates
v1.2.5- Added
clean_pdf_research - Added
clean_web_content - Added
clean_youtube_transcript - Removed
deep_research_briefing - Removed
extract_json_schema - Removed
fetch_batch_clean_markdown - Removed
fetch_clean_web_content - Removed
fetch_pdf_markdown - Removed
fetch_plain_text - Removed
fetch_youtube_transcript - Added
get_vault_balance
3 tool updates
v1.2.1- Added
deep_research_briefing - Added
extract_json_schema - Added
fetch_batch_clean_markdown
5 tool updates
v1.2.0- First observed
fetch_clean_web_content - First observed
fetch_pdf_markdown - First observed
fetch_plain_text - First observed
fetch_youtube_transcript - First observed
get_payment_info
TDQS
Scored across 5 tools
Each tool targets a clearly distinct resource and action: the two get_* tools separate payment/pricing info from vault balance/session status, and the three clean_* tools are cleanly split by source type (web, YouTube, PDF). An agent would not likely confuse which tool to select for a given task.
All tool names follow a consistent verb_noun snake_case pattern. The clean_* tools share a uniform prefix with source-specific suffixes, and the get_* tools use the same straightforward verb-based convention.
Five tools is a compact, well-scoped set for an x402 data agent: three content-cleaning tools covering common data sources and two payment/session tools. There is no obvious redundancy or unnecessary bloat.
The core data-cleaning and payment-information workflows are covered: pricing, balance, and three major content formats. The only notable gap is the lack of a tool to directly execute a payment or manage vault sessions, though this may be handled externally via x402 endpoints.
Maintenance
Related MCP Connectors
Stealth scraping API for AI agents. Clean Markdown from any URL. x402 crypto payments.
Pay-per-request webpage-to-Markdown extraction for AI agents. $0.005 USDC via x402 on Solana.
Pay-per-call (x402/USDC-Base) web + crypto data tools for AI agents: audit, extract, crypto, DeFi.
Pay-per-call web scraping for AI agents via x402 on Base USDC. Six tools, no signup.
Related MCP Servers
- AlicenseAqualityBmaintenancePay-per-use clean web reader for AI agents. URL in, markdown plus metadata out, in milliseconds. Settled per-call in USDC over x402 โ no signup, no API keys.11252MIT
- AlicenseNot gradedqualityDmaintenanceMCP server providing 17 keyless, pay-per-use web-data tools with signed-provenance receipts, enabling AI agents to autonomously fetch, extract, and verify web content on Base mainnet.27MIT

nanoparse-mcpofficial
AlicenseAqualityBmaintenanceMCP server that enables AI agents to fetch web content as clean, structured Markdown via NanoParse's hosted API, using x402 micropayments in USDC on Base.1439MIT- AlicenseNot gradedqualityDmaintenanceMCP server providing 11 pay-per-call web intelligence tools (page reading, PDF extraction, RSS parsing, screenshots, summarization, structured data extraction) for AI agents, paid automatically in USDC via the x402 protocol on Base mainnet with no API keys required.49MIT