{"uid":"cap_PaynaEzA2JM2wvPhkA1mF","slug":"contextslim-mcp-api-fetch-cached-context-get-3fa98072","name":"ContextSlim MCP API – Fetch Cached Context (GET)","description":"[MCP: optimize_context] Pay-per-call JSON context pruning & LLM token budget enforcement. Saves up to 85% prompt tokens.","url":"https://contextslim.friczero.com/message","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","HEAD","DELETE"],"type":"string"},"queryParams":{"type":"object","additionalProperties":{"type":"string"}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"result":{},"status":"success","metrics":{"savedTokens":528,"slimmedTokens":94,"originalTokens":622,"strategyApplied":"prune_arrays","reductionPercentage":"84.9%"},"toolResultReference":{"expiresIn":"3600s","fetchTool":"fetch_result","referenceId":"ref_12345678"}}},"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_4otf1Ex8doDv-KtmAJ_iw","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":"Retrieves a previously optimized and cached context payload using a reference ID returned by the optimize_context tool.","exampleAgentPrompt":"Fetch the cached context result with reference ID 'ref_12345678' so I can continue the conversation using the previously pruned payload without re-running the full optimization.","exampleUseCases":[{"title":"Multi-turn agent memory retrieval","prompt":"I ran a context optimization earlier that returned reference ID 'ref_abc99'. Fetch that cached slim payload now so the agent can pick up where it left off without re-sending the full JSON."},{"title":"Low-latency tool result reuse","prompt":"Retrieve the ContextSlim cached result for reference 'ref_xyz456' — I need the pruned tool output back quickly to feed into the next step of my pipeline without re-processing."},{"title":"Long-running workflow checkpoint","prompt":"My agent stored a compressed context snapshot with ID 'ref_turn7_session3'. Get that back for me so we can resume the workflow from that checkpoint instead of starting fresh."}],"resultDescription":"Returns the pruned JSON payload previously generated by optimize_context, along with token metrics (original tokens, slimmed tokens, tokens saved, reduction percentage, strategy applied) and a tool result reference object containing the referenceId, fetchTool name, and expiry duration. Delivered as a JSON object with a 'success' status field.","failureModes":["Missing or invalid referenceId returns an error — the referenceId query parameter is required and must be non-empty","Expired referenceId (past 3600s TTL) returns a cache miss or not-found error","Invalid or malformed MCP method enum value causes a schema validation error","Payment failure or missing x402 header results in a 402 Payment Required response","Network timeout or upstream KV cache unavailability causes a 5xx error"],"whenToPreferThis":"Use this endpoint when an agent has already called optimize_context and received a referenceId, and now needs to retrieve the cached pruned payload — especially across conversation turns or pipeline steps. Prefer this over re-running optimization when the cached result is still within its TTL, to save tokens and cost. Ideal for multi-turn LLM agents and long-running workflows where re-transmitting full JSON is prohibitive.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T06:38:19.175Z","isFirstParty":false}