MCP server that minimizes AI agent token usage — context compression, caching, web extraction, conversation pruning
TokenSaver demonstrates solid tool design with clear, action-oriented names (count_tokens, compress_context, cache_store) and comprehensive parameter descriptions. All 10 tools have documented input schemas with types and descriptions. However, output schemas are not explicitly documented in the source code, only inferred from docstrings. Error handling is minimal; tools lack recovery guidance and actionable error messages. Parameter validation rules are described in docstrings but not enforced via JSON Schema constraints (enums, min/max). The server follows good composition patterns (single responsibility, tool chaining via IDs) but lacks formal output documentation and error classification.
Analyze current token usage vs model context window and recommend what to trim. Use this meta-tool to know WHERE to apply compress_context, prune_conversation, or other tokensaver tools for maximum effect.
Retrieve a cached result. If hit, skip re-running the original tool.
Remove a stale cache entry (e.g. after file changes).
Store a tool result in the persistent cache with a TTL. Prevents re-running the same expensive operation twice.
Compress long text or conversation history into a dense summary. Use before re-injecting large context on repeated turns.
Estimate token count for text or a message list before sending to an API. Use this to decide whether to compress, prune, or skip content.
Output schemas not formally documented. Tool docstrings describe return fields informally (e.g., 'Returns: model, context_window, current_tokens...') but no JSON Schema output type is visible in the source. LLMs cannot reliably parse unstructured return descriptions.
Error handling lacks recovery guidance. Tools return errors (e.g., 'Unknown model') but do not guide the LLM on next steps. No error classification (retryable vs user-fixable vs fatal) or actionable suggestions.
Parameter constraints not enforced via JSON Schema. Enums (e.g., mode=['extractive','abstractive'] in compress_context) are documented in descriptions but not declared as JSON Schema enum constraints. LLMs may hallucinate invalid values.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | C | 60 | 2026-07-28+ | v2 |
Fetch a webpage and return only its main readable content — no HTML, scripts, navigation, ads, or cookie banners. Saves 85–95% of tokens vs raw HTML.
Shorten a verbose or redundant prompt/system prompt while preserving intent. Typical savings: 30–65%. Run once on system prompts that accumulate over iterations.
Reduce conversation history token footprint by removing filler turns and compressing older verbose ones. Saves 60–80% on long conversations.
Summarize a file or directory without reading every byte. Agents get full structural understanding in ~500 tokens instead of 50,000+.
Tool chaining IDs not guaranteed in responses. extract_webpage and summarize_file accept file paths but do not document whether they return structured IDs for downstream tool use. Unclear if results can be directly piped to compress_context.
No pagination or result limits documented for list-like operations. cache_store/cache_get operate on single keys, but no guidance on how many cache entries can exist or how to enumerate them. Potential for context window exhaustion.