A Model Context Protocol server for collecting AI usage statistics
Single tool with partial but incomplete schema and description. The tool 'submit_stats' is directly visible in source code with explicit registration via setRequestHandler(ListToolsRequestSchema...). Input schema is present with typed properties and required fields, but descriptions are present but generic. The description 'Submit AI usage statistics' is only 31 characters, at the lower end but acceptable. Parameter descriptions vary in quality: 'volume_bytes' has a detailed 119-char description; 'code' is vague at 37 chars ('Text of the code generated/altered'); 'workspace_dir' has a poorly translated description ('nome do diretório do projeto', Portuguese mixed with English). Output schema is implicit (returns {content: [{type: 'text', text: string}]}) but not documented for the LLM. No error handling guidance, the tool throws generic errors without recovery suggestions. No pagination, batching, or composition patterns. No parameter constraints (enums, ranges). The naming 'submit_stats' is acceptable (verb_noun form), but the tool accepts multiple unrelated parameters (volume, code, language, workspace, lines) suggesting it conflates statistics submission with code indexing, a composition issue.
Submit AI usage statistics
Mixed language in parameter descriptions: 'workspace_dir' description is in Portuguese ('nome do diretório do projeto') rather than English. This confuses LLM interpretation and violates the principle of clarity.
Parameter 'code' description is vague (37 chars: 'Text of the code generated/altered'). Does not explain the purpose or expected format. An LLM cannot infer whether to pass raw code, a diff, or a summary.
Output schema is undocumented. The tool returns {content: [{type: 'text', text: 'Statistics submitted successfully'}]}, but this structure is not defined in the tool registration or anywhere visible to the LLM. The LLM cannot plan what to expect or extract results.
No error handling guidance. When validation fails (e.g., 'volume_bytes must be positive'), the error message is generic: 'Volume and lines must be positive values...'. No recovery suggestion. Does not tell the LLM how to retry or what to do next.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | D | 51 | 2026-07-28+ | v2 |
| 2026-03-09 | F | 39 | - | v1 |
Tool combines multiple concerns: statistics submission, code indexing, Git repository detection, file logging, and remote stats posting. This violates single-responsibility. Should be split into submit_stats, index_code, and get_repository_metadata.
No parameter constraints. 'language' is free-form string (converted to lowercase), but no enum. 'lines' and 'volume_bytes' accept any positive number with no validation for realistic ranges. LLMs can pass nonsensical values like 10,000,000 bytes.
Sensitive credentials (STATS_SERVER_URL, USERNAME) are loaded from environment but sent in request body and logged to console. If this server runs in a logged environment (CI, hosting platform), credentials risk exposure.
No input validation or sanitization for 'workspace_dir' parameter. The tool calls fs.readFileSync and constructs paths directly. Path traversal attacks possible (e.g., pass '../../../etc/passwd'). No guard against malicious input.