A codebase mapper tool that analyzes Python files to extract and map import topology
This MCP server has one tool, map_imports, with significant quality gaps. The tool name follows verb_noun convention (map_imports), which is good. However, the schema is extremely sparse, the description lacks specificity about the return format and use cases, and the implementation reveals several correctness issues. The code does not handle imports correctly, it naively splits on whitespace without accounting for complex import patterns like 'from X import Y, Z' or 'import X as Y'. The tool lacks output schema documentation, error handling, parameter validation, and any guidance for the LLM on downstream usage.
Maps and extracts import statements from Python file content, returning a deduplicated list of imports
Input schema lacks description for the required parameter 'python_file_content'. Currently, LLMs cannot determine the expected format, encoding, or constraints.
No output schema documented. The tool returns {'import_topology_list': list(set(imports))}, but the LLM has no visibility into the structure, field types, or semantics of 'import_topology_list'.
Tool description is vague and lacks context for LLM selection. The description 'Maps and extracts import statements from Python file content, returning a deduplicated list of imports' does not explain WHEN to call it, what downstream tools it chains with, or what the return structure looks like. When should the LLM call it instead of a similar tool? What does it return?
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | F | 40 | 2026-07-28+ | v2 |
Implementation has a critical correctness bug. The code 'imports = [line.split()[1] for line in lines if line.startswith("import ") or line.startswith("from ")]' does not handle multi-import statements ('import sys, os') or aliased imports ('import numpy as np'). For 'from X import Y, Z', it extracts only 'import' (the second token), not the actual module names. This will produce incorrect results for real Python files.
No error handling. The tool will crash on malformed input (e.g., empty lines, non-UTF-8 content, files with syntax errors).
Parameter lacks format/constraint documentation. The description does not specify: Is the file content expected to be a string? UTF-8 encoded? Valid Python syntax? Entire file or snippet?
Tool description is under-length (89 chars). This description is sparse and does not meet the 10-1024 character guideline for LLM signal.