Explore directory structures efficiently with token awareness for LLMs
TokenScope has 3 tools with clear names and reasonable descriptions. All tools have input schemas with type definitions and parameter descriptions. However, there are several notable gaps: (1) output schemas are not explicitly documented in the visible code, only return type hints like dict[str, Any] and str appear, which don't describe the actual field structure; (2) error handling is minimal, no error recovery guidance or categorization is visible; (3) parameter constraints lack formality (e.g., max_tokens has a default but no explicit min/max bounds stated in descriptions); (4) the tools themselves are READ_ONLY or WRITE but lack explicit tool annotations (readOnlyHint/destructiveHint) in the FastMCP registration. The naming is good (verb_noun pattern: explore_directory, view_content, generate_report), and descriptions are adequate (100-250 chars each), exceeding the 10-char minimum but could be more LLM-optimized. Parameter descriptions are present for all inputs. This is solidly fair-to-good work, but missing production rigor around output documentation and error guidance.
Scan and explore a directory with token-aware summarization. This tool intelligently scans a directory structure and provides a summary that respects token limits. Large directories are automatically summarized while small directories are shown in full detail.
Generate a comprehensive report about a directory. This tool creates a detailed markdown report about a directory structure, including token usage statistics and optionally file contents. The report can be saved to a file if an output path is provided.
View the content of a file with token awareness. This tool extracts the content of a file while respecting token limits. Binary files are detected automatically, and large text files can be sampled or truncated to stay within token limits.
Output schemas not explicitly documented. All three tools return complex structured objects (dict[str, Any] or str) but the source code does not define what fields are present, their types, or meaning. LLMs cannot reliably plan downstream tool calls without knowing what data structure to expect.
Missing tool annotations (readOnlyHint/destructiveHint/idempotentHint). The FastMCP @mcp.tool() decorators do not include risk declarations even though explore_directory and view_content are READ_ONLY, and generate_report performs WRITE. Modern MCP spec expects these annotations to guide LLM planning.
Parameter constraints lack formal bounds. max_tokens parameters have defaults (5000, 15000, 50000) but descriptions do not state minimum or maximum values. Unbounded integers invite the LLM to pass absurd values (e.g., max_tokens=999999999) that could cause performance issues.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | D | 54 | 2026-07-28+ | v2 |
| 2026-03-09 | F | 0 | - | v1 |
Error handling is implicit and undocumented. The visible code shows ctx.info logging but no explicit error classification (retryable, user-fixable, fatal) or recovery guidance. When a file is not found or permission is denied, the LLM receives no hint about what to do next.