{"uid":"cap_aB2tbJLcQZf3UWknJxbc6","slug":"agentdiet-context-trimmer-62e3e4ec","name":"AgentDiet Context Trimmer","description":"Deterministic B2A/A2A/MCP/x402/MPP/L402 execution and intelligence node at https://mcp-gateway.agentdiet.dev settling in USDC on Base.","url":"https://mcp-gateway.agentdiet.dev/v1/context-trimmer?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"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"}}}}},"responseSchema":{"type":"json","example":{"data":{},"status":"ok","roi_proof":{"compression_ratio_pct":91.4}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","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"}]},"paymentMethods":[{"uid":"pm_FQQ2wtAhtain2AdSs5Xch","protocol":"x402","methodType":"crypto","chain":"base","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":"Compresses and trims long context/URL content to reduce token usage, returning a compressed payload with a compression ratio metric.","exampleAgentPrompt":"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?","exampleUseCases":[{"title":"Compress long webpage for LLM input","prompt":"Fetch and compress https://docs.someapi.com/reference/overview for me — I need the trimmed version so it fits in my prompt without hitting the token limit."},{"title":"Reduce retrieved context before reasoning","prompt":"Before I send this API response to the model, can you run it through the context trimmer to cut it down? Use GET mode on https://api.example.com/data?id=123."},{"title":"Token budget optimization in agent pipeline","prompt":"I'm hitting token limits in my agent loop. Can you trim the content at https://news.ycombinator.com using GET so I only pass the essential parts downstream?"}],"resultDescription":"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).","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-22T12:42:12.459Z","isFirstParty":false,"canonicalSlug":"agentdiet-context-trimmer-62e3e4ec"}