{"uid":"cap_wBqdAFmSUnsNyFMU0cfdm","slug":"mesh-agentdiet-dev-context-bloat-eliminator-url-html-distiller-with-8be44f0d","name":"Context Bloat Eliminator — 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://mesh.agentdiet.dev/v1/context-bloat-eliminator)","url":"https://mesh.agentdiet.dev/v1/context-bloat-eliminator?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_2Q5NTdoRDm0fj0vEdP4As","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"mesh.agentdiet.dev","brandSlug":"mesh-agentdiet-dev-mpp","brandBaseUrl":"https://mesh.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches and distills a URL or raw HTML into clean Markdown, structured JSON, skeleton outline, or a BM25-focused token-budget excerpt to reduce LLM context bloat","exampleAgentPrompt":"Fetch https://stripe.com/docs/payments and distill it into clean markdown, keeping only the most relevant parts about payment intents — use budget mode with my query 'payment intents' and a 500 token ceiling so it fits in my prompt without blowing up the context.","exampleUseCases":[{"title":"Grounding agent on documentation page","prompt":"Pull the Stripe docs from https://stripe.com/docs/api and distill them into structured markdown — I only want the key tables and parameters, nothing else, so my agent doesn't run out of context window."},{"title":"BM25 relevance filter for research query","prompt":"Fetch https://en.wikipedia.org/wiki/Transformer_(machine_learning_model) and give me only the parts relevant to 'attention mechanism' using budget mode, capped at 300 tokens — I need it tight enough to fit inside a bigger prompt."},{"title":"HTML payload cleanup before LLM processing","prompt":"I've got a raw HTML blob from a scraped news article — can you distill it into clean markdown and strip all the nav, ads, and sidebar junk? It's too noisy for my LLM to handle as-is."}],"resultDescription":"Returns a 'data' object containing the distilled output (Markdown text, structured JSON tables/metadata, skeleton outline, or BM25 budget excerpt depending on mode), plus an 'roi_proof' block showing raw_tokens, distilled_tokens, tokens_saved, compression_ratio_pct, and llm_cost_saved_usd. Also includes cache status (HIT/MISS) and billing details.","failureModes":["URL unreachable or returns non-200 — distillation cannot proceed","Token budget too small (max_tokens < 20) — rejected by schema validation","Empty or unparseable HTML payload — may return minimal or empty distilled output","BM25 query missing when mode=budget — query field required for budget mode","Rate limit or payment failure — x402 payment not processed correctly","Malformed URL string — validation error on the url field"],"whenToPreferThis":"Use this endpoint when an AI agent needs to inject web content into an LLM prompt but the raw page is too large or noisy. It is especially valuable when you need token-budget control via BM25 relevance filtering, or when you want structured extraction (tables, metadata, skeleton) rather than raw HTML. Prefer it over generic scrapers when LLM cost savings and compression ratio reporting matter, or when you want a single endpoint that handles both URL fetching and raw HTML distillation with multiple output modes.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T12:40:02.281Z","isFirstParty":false,"canonicalSlug":"mesh-agentdiet-dev-context-bloat-eliminator-url-html-distiller-with-8be44f0d"}