{"uid":"cap_0ffD-tBsOZxLiwXgPzozT","slug":"mcp-security-agentdiet-dev-url-html-distiller-with-bm25-budget-control-93dc309d","name":"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-security.agentdiet.dev/v1/url-to-markdown)","url":"https://mcp-security.agentdiet.dev/v1/url-to-markdown?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_w4SevI43U3YX5KsjdJs06","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-security.agentdiet.dev","brandSlug":"mcp-security-agentdiet-dev-mpp","brandBaseUrl":"https://mcp-security.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches a URL or accepts raw HTML and distills it into compact, agent-ready Markdown with optional BM25 keyword-focused token budget trimming","exampleAgentPrompt":"Fetch https://stripe.com/docs/payments and distill it into compact markdown using budget mode, focused on 'payment intents', with a max of 500 tokens so I don't blow my context window.","exampleUseCases":[{"title":"Token-budget research from live docs","prompt":"Grab https://docs.openai.com/api-reference and distill it down to at most 800 tokens in budget mode, focused on the query 'function calling' — I need just the relevant parts without all the boilerplate."},{"title":"Raw HTML cleanup for agent pipeline","prompt":"I've got a raw HTML dump from a scraper — can you distill it into clean markdown for me? I don't need to fetch anything, just process the HTML I'll paste in, using standard markdown mode."},{"title":"Structured table extraction from a webpage","prompt":"Pull https://en.wikipedia.org/wiki/List_of_S%26P_500_companies and distill it in structured mode so I get the tables and metadata as clean JSON rather than raw HTML."}],"resultDescription":"Returns a distilled content object (Markdown, structured JSON, skeleton outline, or BM25-trimmed excerpt depending on mode), accompanied by ROI proof metrics including raw token count, distilled token count, tokens saved, compression ratio percentage, estimated LLM cost saved in USD, and optionally billing and cache metadata.","failureModes":["URL is unreachable or returns non-200 HTTP — endpoint may return an error status","Requested URL contains no extractable text content (e.g. pure JavaScript SPA without SSR)","Token budget ceiling (max_tokens) is too small to fit even minimal content","BM25 query in budget mode matches nothing relevant, returning near-empty excerpt","Payment not completed via x402 — 402 response before content is returned","Rate limiting or timeout on slow-loading target pages"],"whenToPreferThis":"Choose this endpoint when an AI agent needs to read or reference web content but must stay within a token budget, reduce LLM inference costs, or extract only query-relevant sections via BM25 scoring. It is especially valuable over raw fetch-and-paste approaches when the target page is verbose (documentation, Wikipedia, news articles) and you need a clean, structured, token-efficient representation. Prefer the budget mode when you have a specific question and a hard token ceiling; prefer structured mode when you need tables or metadata; prefer skeleton mode for quick page outlines.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-17T18:52:28.640Z","isFirstParty":false,"canonicalSlug":"mcp-security-agentdiet-dev-url-html-distiller-with-bm25-budget-control-a3649f3f"}