{"uid":"cap_Qc0bRYdCt74UpJjvSeGgy","slug":"agentdiet-a2a-context-window-distiller-67c5efe0","name":"AgentDiet — A2A Context Window Distiller","description":"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)","url":"https://mcp-security.agentdiet.dev/v1/rag-diet?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"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"}}},"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":["x402"],"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":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_mKVoEH787VZiYiRpJA4Is","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null},{"uid":"pm_EIVgWd7p5w_JR9JRG1h6v","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"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","exampleAgentPrompt":"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'.","exampleUseCases":[{"title":"Documentation page token compression","prompt":"Grab the Next.js routing docs at https://nextjs.org/docs/app/building-your-application/routing and distill them into structured markdown — I need it under 800 tokens so it fits in my agent's context window."},{"title":"Focused research excerpt for agent grounding","prompt":"Pull https://en.wikipedia.org/wiki/Transformer_(deep_learning_architecture) and give me a budget-mode excerpt focused on 'attention mechanism', capped at 300 tokens — I only want the relevant bits."},{"title":"Skeleton outline of a long article","prompt":"Distill https://www.paulgraham.com/greatwork.html into a skeleton outline so my agent can see the structure of the piece without burning through my entire context window."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-20T00:35:59.590Z","isFirstParty":false,"canonicalSlug":"agentdiet-a2a-context-window-distiller-67c5efe0"}