# AgentDiet Context Trimmer

> AgentDiet Context Trimmer is a paid API for AI agents from mcp-gateway.agentdiet.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-22).

Compresses and trims long context/URL content to reduce token usage, returning a compressed payload with a compression ratio metric.

## Facts

- Endpoint: GET https://mcp-gateway.agentdiet.dev/v1/context-trimmer?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-22
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentdiet-context-trimmer-62e3e4ec
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_aB2tbJLcQZf3UWknJxbc6

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-context-trimmer-62e3e4ec
```

Example prompt: Can you trim and compress the content at https://example.com/long-article using GET mode so it fits in my context window without blowing up my token budget?

## When to prefer this

Use this endpoint when an AI agent needs to fetch and compress remote content (web pages, API responses) to fit within a limited context window, reduce LLM token costs, or preprocess large documents before reasoning. It is particularly useful in agentic pipelines where retrieved context routinely exceeds token budgets. Prefer this over general-purpose summarization endpoints when you need a deterministic compression ratio proof rather than an LLM-generated summary.

## Known failure modes

- Missing or invalid 'url' query parameter returns an error
- Unsupported HTTP method (not GET or POST) rejected by schema validation
- Unreachable or non-existent URL results in fetch failure
- Very short content may yield low or zero compression ratio
- Network timeout on slow remote URLs
- Payment failure or insufficient USDC balance blocks execution

## How this service works

Deterministic B2A/A2A/MCP/x402/MPP/L402 execution and intelligence node at https://mcp-gateway.agentdiet.dev settling in USDC on Base.

## Output

A JSON object with a 'data' field containing the compressed content, a 'status' field ('ok' on success), and a 'roi_proof' object containing 'compression_ratio_pct' indicating how much the content was compressed (e.g. 91.4% reduction).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "POST"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "url": {
       "type": "string"
      },
      "mode": {
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {},
  "status": "ok",
  "roi_proof": {
   "compression_ratio_pct": 91.4
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agentdiet-context-trimmer-62e3e4ec/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from mcp-gateway.agentdiet.dev](https://www.zero.xyz/host/mcp-gateway.agentdiet.dev/llms.txt)
