{"uid":"cap_YpLHOTBTLa-UvWqqyBdHt","slug":"rag-context-sanitizer-37420732","name":"RAG Context Sanitizer","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/workflows/rag-context-sanitizer?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":{"text":{"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.005","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.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_6k9osAzwQHr_F2lmANvUX","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Sanitizes and compresses raw text input for RAG pipelines, returning cleaned context with a compression ratio proof","exampleAgentPrompt":"Can you sanitize this retrieved context text before I pass it to the LLM? Here's the raw chunk: 'The quick brown fox... [repeated boilerplate, noise, irrelevant headers]' — I need it cleaned and compressed.","exampleUseCases":[{"title":"RAG pipeline noise removal","prompt":"I have a bunch of retrieved document chunks from my vector DB that are full of boilerplate, HTML artifacts, and repeated sentences. Can you sanitize and compress them so I only pass clean, relevant context to the LLM?"},{"title":"Token budget optimization before LLM call","prompt":"My retrieved context is way too long and blowing my token budget. Can you run it through the RAG context sanitizer to compress it down and show me the compression ratio I'm getting?"},{"title":"Preprocessing scraped web content","prompt":"I scraped a bunch of web pages for my RAG system but they're full of nav menus, ads, and footer junk. Can you clean this text up so only the meaningful content goes into my embeddings?"}],"resultDescription":"Returns a JSON object with a 'data' field containing the sanitized/compressed output text, a 'status' field ('ok' on success), and an 'roi_proof' object that includes a 'compression_ratio_pct' value (e.g. 91.4) indicating how much the input was compressed.","failureModes":["Missing required 'text' query parameter returns an error or empty data","Input text that is already clean may return near-zero compression with minimal transformation","Oversized text inputs may be truncated or rejected","Payment failure (insufficient USDC balance) results in HTTP 402 and no processing","Network timeout on large text inputs","Malformed input schema returns validation error"],"whenToPreferThis":"Choose this endpoint when you need a lightweight, pay-per-use text sanitization step specifically optimized for RAG context windows, with verifiable compression metrics. Prefer it over manual preprocessing when you want a deterministic, auditable compression ratio proof for your pipeline, or when operating in an agent-to-agent (A2A) workflow that requires x402 micropayment settlement on Base.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-22T12:43:55.752Z","isFirstParty":false,"canonicalSlug":"rag-context-sanitizer-37420732"}