AST-based context pruner for LLMs and AI coding agents via the Model Context Protocol (MCP)
ContextCut defines 3 tools with complete input schemas and descriptions. Naming follows verb_noun convention (prune_code_context, check_license, get_savings_report). Descriptions are substantive (100-200 chars), exceeding the 10-char minimum. All parameters have type definitions and descriptions. However, output schemas are entirely undocumented, the tool definitions declare no return type structure, forcing LLMs to guess what fields to expect. Error handling is absent: no guidance on license validation failures, file-not-found scenarios, or Pro feature gating. The telemetry integration (recordPruneEvent) is internal and invisible to the LLM. Parameter descriptions lack actionable constraints (e.g., glob_pattern accepts any string with no format guidance; depth enum is documented but no default is stated). The license_key parameter appears in two tools but is never validated in the visible schema, validation happens server-side, which is correct for secrets, but the parameter description should clarify this is optional and environment-variable-backed.
Checks ContextCut license tier status (Free vs Pro).
Generates an aggregated cost-benefit and token savings ROI report over a specified interval (daily, weekly, monthly, or all_time) based on persistent local history.
Reads a source file or directory (or raw string) and returns an AST-pruned version containing only signatures, types, interfaces, and docstrings. Replaces function/method bodies with stubs to drastically cut token consumption and latency. Python pruning is free; TypeScript/JavaScript pruning is a Pro feature.
No output schemas documented. Tool definitions declare input schemas but omit return type structures. LLMs cannot plan downstream operations or extract required fields (e.g., does prune_code_context return {pruned_code, savings_tokens, file_count}?). This violates pattern:tool and forces LLMs to infer structure from trial and error.
Error handling absent. No guidance on license validation failures, file-not-found, permission errors, or Pro feature gating. When check_license fails or prune_code_context hits a Pro-only file, the LLM receives no recovery hint. Violates pattern:recovery-guide.
Parameter constraints underspecified. glob_pattern accepts any string with no format guidance (e.g., '*.py' vs '**/*.py' vs invalid syntax). depth enum is documented but no default is stated. license_key is optional but the description does not clarify it falls back to CONTEXTCUT_LICENSE_KEY env var. Violates pattern:constrained-input.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | D | 53 | 2026-07-28+ | v2 |
Telemetry and cost reporting are internal. formatTsTelemetry() generates token savings estimates but this is not exposed as a tool output field or separate tool. LLMs cannot reason about cost-benefit or plan multi-file pruning strategies. The get_savings_report tool exists but its output schema is undocumented.
Language auto-detection logic is complex but not exposed to LLM. isTypeScriptOrJavaScript() infers language from file extension, tsconfig.json presence, or directory contents. If auto-detection fails, the LLM has no way to override it except via the language parameter. Description should clarify fallback behavior and when to use language hint.