# URL & HTML Distiller with BM25 Budget Control

> URL & HTML Distiller with BM25 Budget Control is a paid API for AI agents from mcp-security.agentdiet.dev, paid per call via MPP, $0.001/call, status unknown (last checked 2026-11-17).

Fetches a URL or accepts raw HTML and distills it into compact, agent-ready Markdown with optional BM25 keyword-focused token budget trimming

## Facts

- Endpoint: POST https://mcp-security.agentdiet.dev/v1/url-to-markdown?utm_source=zero.xyz
- Price: $0.001/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-11-17
- Activations on Zero: 0
- Provider: mcp-security.agentdiet.dev
- Website: https://mcp-security.agentdiet.dev
- Canonical page: https://www.zero.xyz/c/mcp-security-agentdiet-dev-url-html-distiller-with-bm25-budget-control-93dc309d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_0ffD-tBsOZxLiwXgPzozT

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability mcp-security-agentdiet-dev-url-html-distiller-with-bm25-budget-control-93dc309d -d '<json body>'
```

Example prompt: 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.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

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)

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "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"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/mcp-security-agentdiet-dev-url-html-distiller-with-bm25-budget-control-93dc309d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from mcp-security.agentdiet.dev](https://www.zero.xyz/host/mcp-security.agentdiet.dev/llms.txt)
