# AgentDiet — A2A Context Window Distiller

> AgentDiet — A2A Context Window Distiller is a paid API for AI agents from mcp-security.agentdiet.dev, paid per call via x402 or MPP, $0.001/call, status unknown (last checked 2026-11-20).

Fetches a web URL and compresses its content into compact, agent-ready tokens using extraction modes (markdown, structured, skeleton, or budget) with BM25 focus queries and strict token ceilings

## Facts

- Endpoint: GET https://mcp-security.agentdiet.dev/v1/rag-diet?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402, MPP
- Status: unknown
- Last checked: 2026-11-20
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentdiet-a2a-context-window-distiller-67c5efe0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Qc0bRYdCt74UpJjvSeGgy

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 agentdiet-a2a-context-window-distiller-67c5efe0
```

Example prompt: Distill https://docs.stripe.com/payments/accept-a-payment into compact markdown using budget mode, keep it under 500 tokens, and focus the extraction on 'payment intents'.

## When to prefer this

Choose this endpoint when an AI agent needs to ground itself on live web content but must stay within a tight context window or token budget. It is especially valuable when passing documentation pages, articles, or web references into an LLM and you want to minimize token costs while preserving semantic fidelity. Prefer it over raw fetch when the target page is long or HTML-heavy. Use budget mode with a query when only a specific sub-topic within the page is relevant.

## Known failure modes

- Invalid or unreachable URL returns an error status
- URL resolves to a page that blocks scraping (403/bot protection)
- mode enum value not recognized causes validation error
- max_tokens set below 20 fails schema validation
- limit parameter exceeding 100 rejected by schema
- cursor invalid or expired causes pagination failure
- Page content too sparse to meaningfully compress, low roi_multiplier
- Payment/402 authorization failure blocks request

## How this service works

Distill a web URL into compact agent-ready tokens (Live x402 v2, IETF MPP & MCP endpoint at https://mcp-security.agentdiet.dev/v1/rag-diet)

## Output

Returns a JSON object with a 'data' field containing the distilled content in the requested format (markdown text, structured JSON tables/metadata, skeleton outline, or BM25-focused budget excerpt), plus an 'roi_proof' object showing raw vs distilled token counts, tokens saved, compression ratio percentage, ROI multiplier, and estimated LLM cost saved in USD. Also includes cache status (HIT/MISS), billing details, and execution status.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "url"
 ],
 "properties": {
  "url": {
   "type": "string",
   "minLength": 1,
   "description": "Target webpage URL to distill (or builtin://stripe-docs)"
  },
  "mode": {
   "enum": [
    "markdown",
    "structured",
    "skeleton",
    "budget"
   ],
   "type": "string",
   "default": "markdown",
   "description": "Extraction mode: markdown, structured, skeleton, or budget"
  },
  "limit": {
   "type": "integer",
   "default": 20,
   "maximum": 100,
   "minimum": 1,
   "description": "Maximum number of items to return per page (1-100)"
  },
  "query": {
   "type": "string",
   "description": "BM25 focus query when mode=budget"
  },
  "cursor": {
   "type": "string",
   "description": "Opaque pagination cursor for fetching the next page"
  },
  "max_tokens": {
   "type": "integer",
   "minimum": 20,
   "description": "Strict token 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/agentdiet-a2a-context-window-distiller-67c5efe0/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)
