Skip to main content
Glama
segentic-lab

codelens-mcp

by segentic-lab

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

TableJSON Schema
NameRequiredDescriptionDefault
pathYesFile 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.
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden and delivers richly: it discloses the return JSON schema, the meaning of `hasErrors`, list truncation at 500 with a `truncated` field, language support, and the fact that Python exports come from `__all__`. The caution 'A signature is not the body' adds a relevant behavioral expectation. This is a model of transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but densely packed with useful details; the main purpose is front-loaded and subsequent sentences add return-format details, language support, usage guidance, and clarity about truncation and nested functions. No sentence is wasted, though the 'codelens is a navigation map' line slightly rephrases the opening purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is comprehensive for a one-parameter read-only exploration tool. It specifies the return shape precisely, covers edge cases like syntax errors and truncation, lists supported languages, and provides usage context. Even without an output schema, the agent would know exactly what to expect.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% for the single `path` parameter, which already explains path resolution, supported extensions, and array handling. The description doesn't add further parameter-level meanings, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function with a specific verb+resource: it provides a structural map of source files listing imports, exports, classes, and top-level functions. It differentiates from the sibling `functions` tool by explicitly noting nested functions are excluded and directing users to that tool. This gives both a clear purpose and a contrast with alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit guidance is provided: 'Use this FIRST to orient in an unfamiliar file' and 'use it to LOCATE code, then Read the actual source before judging or modifying it.' The description also points to the `functions` tool for nested functions, establishing when not to use this tool. This exceeds typical usage guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/segentic-lab/codelens-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server