ContextShrink provides three read-only utility tools for token analysis and compression with adequate but unexceptional schemas and descriptions. All tools have names, descriptions, and input schemas visible in mcp-server.js. Naming follows verb_noun convention (analyze_tokens, compress_text, count_tokens) and is clear. However, several issues prevent a higher score: (1) parameter descriptions lack formatting guidance and constraint details (e.g., target_ratio description omits the 0-1 range even though it's enforced in validation); (2) no documented output schemas for users to understand response structure; (3) model parameter is optional but descriptions suggest 'model name' without clarifying default behavior or supported values; (4) error messages are minimal ('Error: {message}') without recovery guidance; (5) no tool annotations (readOnlyHint, idempotentHint) despite all three being read-only operations. The implementation itself is solid, type checking, validation, and parameter handling are correct, but the interface definition lacks polish for production agent environments.
Analyze an LLM prompt or text by segment — shows token breakdown per section (headers, code blocks, paragraphs) with compression suggestions.
Compress a prompt or document to reduce token count. Returns compressed text with savings report and safety warnings.
Count tokens in a text string for a given model. Returns count and whether it is exact or estimated.
Output schemas not documented. LLMs cannot plan downstream operations or extract fields from responses without knowing response structure. No documentation of what fields analyze_tokens, compress_text, and count_tokens return.
Parameter constraints not fully documented. target_ratio description omits the 0-1 range constraint enforced in code (line 70-71). model parameter lacks valid value list (only shows examples, not enum). Text parameter has no length limit documentation despite MAX_CHARS=500_000 existing in server.js.
Tool annotations missing. All three tools are read-only, idempotent operations but lack readOnlyHint and idempotentHint annotations. These hints help agents optimize planning and prevent unnecessary retries or safety checks.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | D | 56 | 2026-07-28+ | v2 |
| 2026-03-09 | D | 55 | 2024-11-05+ | v1 |
Error handling lacks recovery guidance. Error responses are formatted as 'Error: {message}' with no actionable next steps. Per pattern:recovery-guide, errors should suggest what the LLM should try next (e.g., 'text exceeds limit, try splitting into smaller chunks').
Model parameter behavior unclear. 'model' is optional in all three tools but descriptions don't explain what 'default' tokenization means or how it differs from explicit model selection. Code returns 'model: model || "default"' but what does 'default' tokenize with?