overview
Produce a structural map of source files with imports, exports, classes, and functions, each with line numbers, so you can locate and jump to relevant code fast.
Instructions
Structural map of source files: imports, exports, classes (with method names, including class-field arrow methods), and top-level functions — each with 1-based line/endLine so you can jump straight to a Read. Returns JSON {path, language, totalLines, hasErrors, imports[], exports[], classes[{name,line,endLine,methods[]}], functions[{name,line,endLine,exported}]}. hasErrors:true means the file has syntax errors and items may be missing (parseErrors lists the offending line ranges). Nested functions are NOT listed here (use the functions tool). Lists cap at 500 entries; when capped, truncated. holds the true total. Languages: TypeScript (.ts/.tsx/.mts/.cts), JavaScript (.js/.jsx/.mjs/.cjs), Python (.py). Python exports come from all. Use this FIRST to orient in an unfamiliar file. codelens is a navigation map: use it to LOCATE code, then Read the actual source before judging or modifying it. A signature is not the body.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File path. Relative paths resolve against the server's working directory; absolute paths are allowed only inside it (anything outside is rejected — call info to see the root). Supported: .ts .tsx .mts .cts .js .jsx .mjs .cjs .py. Accepts a single path or an array of up to 20 paths; an array returns {results, summary} with per-file entries. |