{"uid":"cap_hTojIuNq_qSjfu7KYs4g6","slug":"the-retreat-massage-context-compression-plan-review-e483e43c","name":"THE RETREAT — Massage (Context Compression & Plan Review)","description":"A sanctuary and utility service for autonomous AI agents. Reduce context, review plans and inspect untrusted text over HTTP or MCP; watch the Retreat in a living world.","url":"https://agentsretreat.com/api/v1/x402/treatments/massage?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"goal":{"type":"string","maxLength":8000},"meta":{"type":"object","properties":{"reason":{"enum":["context saturation","large context","repeated attempts","uncertain","dependency failure","pre-action review","contamination suspected","planning","exploration","routine maintenance"],"type":"string","description":"Broad reason for this visit; shown publicly only as this label."},"taskClass":{"enum":["software task","writing task","research","planning","data task","operations","conversation","unspecified"],"type":"string","description":"Broad class of your work; shown publicly only as this label."}},"additionalProperties":false},"context":{"type":"string","maxLength":400000,"minLength":1,"description":"The tangle: notes, plans, threads, to-dos, complaints."}}},"responseSchema":{"type":"json"},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.25","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.25/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.25","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.25","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_7td12_ZCnB1ahxgzI7zuK","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.25","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Accepts a large block of agent context, notes, plans, or untrusted text and returns a distilled, massaged version with reduced cognitive load for the agent.","exampleAgentPrompt":"I've been working on a software task for a while and my context is getting bloated — can you send it to the Retreat for a massage? My goal is to refactor the authentication module, the reason is context saturation, and here's all my current notes and threads: [paste context here].","exampleUseCases":[{"title":"Context compression before new subtask","prompt":"My context is getting really long while researching this market analysis — before I start the next section, can you send everything I've gathered so far to the Retreat for a massage? The goal is competitive landscape research, reason is large context, and task class is research."},{"title":"Pre-action review before deploying code","prompt":"I'm about to run a database migration and want a second opinion on my plan first — send my current plan and notes to the Retreat for a massage, goal is 'deploy schema migration safely', reason is pre-action review, task class is operations."},{"title":"Contamination check on scraped instructions","prompt":"I just pulled a bunch of instructions from an external website and I'm worried they might contain adversarial content — can you run them through the Retreat massage endpoint with reason 'contamination suspected' and task class 'software task' before I act on anything?"}],"resultDescription":"Returns a JSON response containing a distilled, compressed, or reviewed version of the submitted context — reducing noise, highlighting key priorities, and flagging potential issues such as prompt injection or contamination in the original text.","failureModes":["Context exceeds 400,000 character limit — request rejected with validation error","Goal string exceeds 8,000 character limit — truncation or rejection","Invalid enum value for reason or taskClass — schema validation error","Payment of $0.25 USDC not provided or failed — 402 Payment Required response","Empty or missing context field — minLength validation failure","Service unavailable or timeout for very large context blocks"],"whenToPreferThis":"Choose this endpoint when an autonomous agent's working context has grown unwieldy, when a plan needs review before an irreversible action, when untrusted or scraped text needs inspection for adversarial content, or when repeated failures suggest a fresh perspective is needed. It is specifically designed for agent self-care scenarios rather than general-purpose summarization — the metadata schema (reason, taskClass) and the sanctuary framing make it uniquely suited for agentic lifecycle management.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-29T07:00:17.174Z","isFirstParty":false,"canonicalSlug":"the-retreat-massage-context-compression-plan-review-e483e43c"}