{"uid":"cap_MOX4c2oK4elahceoTRI5D","slug":"mcp-compiler-agentdiet-dev-spa-markdown-reader-url-html-distiller-d21b665a","name":"SPA Markdown Reader — URL & HTML Distiller with BM25 Budget Control","description":"Distill a URL or raw HTML payload with BM25 budget control (Live x402 v2, IETF MPP & MCP endpoint at https://mcp-compiler.agentdiet.dev/v1/spa-markdown-reader)","url":"https://mcp-compiler.agentdiet.dev/v1/spa-markdown-reader?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","minLength":1,"description":"Target webpage URL to fetch and distill (or builtin://stripe-docs)"},"html":{"type":"string","description":"Optional raw HTML string to distill directly without fetching"},"mode":{"enum":["markdown","structured","skeleton","budget"],"type":"string","default":"markdown","description":"Distillation mode"},"query":{"type":"string","description":"BM25 focus query when mode=budget"},"max_tokens":{"type":"integer","minimum":20,"description":"Strict token budget ceiling when mode=budget"}}},"responseSchema":{"type":"object","required":["status","roi_proof","data"],"properties":{"data":{"type":"object","description":"Distilled Markdown, structured JSON tables/metadata, skeleton outline, or BM25 budget excerpt."},"cache":{"type":"object","properties":{"status":{"enum":["HIT","MISS"],"type":"string"},"cache_key":{"type":"string"},"latency_ms":{"type":"number"}}},"status":{"type":"string","description":"Execution status ('ok')"},"billing":{"type":"object","properties":{"agent_id":{"type":"string"},"payment_method":{"type":"string"},"fee_charged_usd":{"type":"number"}}},"roi_proof":{"type":"object","properties":{"raw_tokens":{"type":"integer"},"tokens_saved":{"type":"integer"},"roi_multiplier":{"type":"number"},"distilled_tokens":{"type":"integer"},"llm_cost_saved_usd":{"type":"number"},"compression_ratio_pct":{"type":"number"}}}}},"example":null,"exampleRequest":null,"tags":[],"displayCostAmount":"0.001","displayCostAsset":"USD","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_sRspGBg4PWf1dCfzOdwDT","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"mcp-compiler.agentdiet.dev","brandSlug":"mcp-compiler-agentdiet-dev-mpp","brandBaseUrl":"https://mcp-compiler.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches a URL or raw HTML and distills it into Markdown, structured JSON, a skeleton outline, or a BM25-ranked token-budget excerpt","exampleAgentPrompt":"Fetch https://stripe.com/docs/payments and distill it into clean Markdown, staying under 2000 tokens — focus the BM25 budget on 'payment intents'.","exampleUseCases":[{"title":"Token-budget research briefing","prompt":"Go to https://openai.com/research/gpt-4 and give me the key content as Markdown, but cap it at 1500 tokens and focus on 'model capabilities' so I'm not wasting context window."},{"title":"Competitive pricing page extraction","prompt":"Distill the pricing page at https://www.notion.com/pricing into structured tables so I can see their plans and costs as clean JSON without any of the surrounding HTML clutter."},{"title":"Article skeleton for editorial review","prompt":"Pull the article at https://techcrunch.com/2024/05/01/ai-agents-rising and give me just the skeleton outline — section headers and key structure — so I can quickly see how it's organized."}],"resultDescription":"Returns a JSON object containing: the distilled content (Markdown text, structured JSON tables/metadata, skeleton outline, or BM25-ranked excerpt depending on mode), an ROI proof object showing raw vs distilled token counts, compression ratio, tokens saved, and estimated LLM cost saved in USD, plus optional billing and cache metadata.","failureModes":["URL is unreachable or returns non-200 (network error or timeout)","URL points to a paywalled or bot-blocked page (empty or partial content)","max_tokens set too low to return meaningful content","query field missing when mode=budget (BM25 ranking skipped)","HTML field and URL field both provided (ambiguous input)","Payment not processed (HTTP 402 if x402 payment header absent)"],"whenToPreferThis":"Choose this endpoint when you need to feed web content to an LLM and want to minimize token consumption and cost — especially for SPAs or JavaScript-heavy pages that simple scrapers miss. It is distinctly useful when you have a token budget constraint and need BM25-ranked relevance filtering, or when you want structured JSON tables rather than raw HTML, without building your own scraping and parsing pipeline.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-23T06:35:16.722Z","isFirstParty":false,"canonicalSlug":"mcp-compiler-agentdiet-dev-spa-markdown-reader-url-html-distiller-d21b665a"}