{"uid":"cap_e1ZnVnzUExxpKg_Wu2sGS","slug":"mcp-security-agentdiet-dev-bm25-budget-controlled-url-html-markdown-2b28927a","name":"BM25 Budget-Controlled URL & HTML Markdown Distiller","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/markdown-distill)","url":"https://mcp-security.agentdiet.dev/v1/markdown-distill?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_BF2KtYI8lZa8lJmvliztD","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 or structured output with optional BM25-ranked token budget control","exampleAgentPrompt":"Distill this webpage — https://stripe.com/docs/payments — into compact markdown using budget mode, focused on the query 'payment intents', and keep it under 500 tokens.","exampleUseCases":[{"title":"Token-efficient documentation ingestion","prompt":"Grab the content from https://docs.openai.com/api-reference and distill it into structured markdown, keeping the output under 800 tokens and focused on the query 'function calling'."},{"title":"Raw HTML cleanup for agent pipeline","prompt":"I have a raw HTML blob from a scraped product page — can you distill it into clean markdown so I can feed it into my agent without wasting tokens?"},{"title":"Skeleton outline extraction from news article","prompt":"Fetch https://techcrunch.com/2024/05/01/ai-agent-trends and give me just the skeleton outline of the article — headings and key structure only, no body text."}],"resultDescription":"Returns a 'data' object containing distilled Markdown, structured JSON tables/metadata, skeleton outline, or a BM25-ranked excerpt depending on mode. Also includes an ROI proof block with raw_tokens, distilled_tokens, tokens_saved, compression_ratio_pct, and llm_cost_saved_usd, plus optional cache status and billing metadata.","failureModes":["URL is unreachable or returns a non-200 status — endpoint may return an error status","HTML payload is empty or malformed — distillation may yield minimal output","Token budget (max_tokens) set too low for meaningful content — output may be truncated aggressively","BM25 query not relevant to page content — budget mode may return low-quality excerpts","Payment not provided or insufficient — HTTP 402 returned blocking execution","URL is behind authentication or a paywall — content cannot be fetched"],"whenToPreferThis":"Choose this endpoint when you need to shrink a webpage or raw HTML into agent-consumable tokens while maintaining semantic relevance. It is especially valuable when operating under LLM context window constraints and you need provable token savings (ROI proof). Prefer the budget+BM25 mode when you only care about content relevant to a specific query. Use over generic scraping tools when you need structured output modes (markdown, JSON tables, skeleton) or cost-efficiency metrics.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T12:40:51.670Z","isFirstParty":false,"canonicalSlug":"mcp-security-agentdiet-dev-bm25-budget-controlled-url-html-markdown-2b28927a"}