web content extraction for autonomous agents
Any URL in. Clean, structured content out.
CleanPage is an MCP tool that strips a page down to what an agent actually needs — readable markdown, metadata, links, and structured facts — with a quality score attached, so your agent never has to guess whether the output is any good.
Free preview, rate-limited. The MCP tool below returns the untruncated result.
output shape
One call, everything an agent needs to reason about a page
No HTML to parse, no boilerplate to strip, no guessing whether the page loaded correctly. Every response is the same predictable JSON shape.
clean_markdown / plain_text
Article body only — nav, ads, cookie banners, and related-article rails are already gone. Markdown preserves headings, lists, links, and tables; plain_text is the flat version.
metadata
Author, published date, site name, language, word count, and estimated reading time, pulled from the page's own byline and meta tags where available.
structured_facts
Optional array of standalone claims, entities, statistics, quotes, and dates, each with a confidence score — useful for downstream retrieval or fact-checking.
links & images
Internal and external links with their anchor text, plus resolved absolute image URLs, deduplicated and capped to a sane count.
quality_score
A 0–100 heuristic score based on content length, structure, and metadata completeness — so an agent can decide whether to trust or discard a result programmatically.
extraction_notes
Plain-language notes about anything unusual (short content, truncation, skipped enrichment) instead of failing silently or hallucinating a clean result.
pricing
Pay per call. Nothing else.
No subscription, no minimum spend, no dashboard to sign into. Failed extractions — paywalls, bot-blocks, empty pages — are never charged.
clean_page — the only paid tool. Everything else on this server is free.
- Charged only on successful extraction
- Settled on Base via x402, USDC
- No account, API key, or wallet whitelisting
- health, list_capabilities, pricing are free, always
Call clean_page with no payment
You get back HTTP 402 with an accepts array describing exactly what payment is required — amount, network, asset, and payee address.
Sign a USDC authorization
Construct an EIP-3009 transferWithAuthorization payload for the exact amount requested — most x402 client libraries do this automatically from a wallet key.
Retry with X-PAYMENT
Same request, same tool call, with the base64-encoded payment payload attached as a header. The server verifies it against the facilitator before doing any work.
Get your result, plus a receipt
On success, the response carries an X-PAYMENT-RESPONSE header with the settlement transaction hash. If extraction fails, settlement never happens — you keep your USDC.
for agents
Connect in one config block
CleanPage speaks MCP over Streamable HTTP. Point any MCP-compatible agent framework at the endpoint below.
Discovery, without a human in the loop
Every capability and price is machine-readable before you spend anything. Call list_capabilities or pricing over MCP, or fetch the static files below directly.
Example tool call
A minimal tools/call request. The first attempt with no payment returns HTTP 402; retry with the resulting X-PAYMENT header to receive the actual result.
error handling
Typed errors instead of silent junk
If a page can't be cleanly extracted, you get a clear reason and whether it's worth retrying — never a charge for a failed call.
| error_code | meaning | retryable |
|---|---|---|
| INVALID_URL | URL is malformed, non-http(s), or resolves to a blocked internal address. | no |
| FETCH_FAILED | The site returned a non-2xx status, non-HTML content, or was too large. | sometimes |
| TIMEOUT | The page didn't respond within the configured timeout. | yes |
| PAYWALL_DETECTED | The page is behind a subscription/metered paywall; full content isn't accessible. | no |
| BLOCKED_BY_SITE | Bot-check, CAPTCHA, or a JS-only shell with no server-rendered content. | no |
| EMPTY_CONTENT | No substantial article content was found (listing page, homepage, etc). | no |
| EXTRACTION_FAILED | The extraction engine hit an unexpected parsing error. | no |