Skip to main content
Glama
segentic-lab

codelens-mcp

by segentic-lab

map

Generate a per-file structural overview of a directory tree in one call — listing classes, functions, and errors — so you can locate relevant code in an unfamiliar codebase.

Instructions

Per-file structural overview of a whole directory tree in one call — the orientation tool for an unfamiliar codebase. Walks the directory recursively (skipping node_modules, dist, build, venv, pycache, hidden dirs and other build/dependency dirs), parses every supported file, and returns JSON {path, files[{path, language, totalLines, classes[], functions[], hasErrors?, error?}], totalSupportedFiles, filesParsed, truncated}. Caps: 200 files per call (truncated:true when more exist — map subdirectories individually to go deeper), 100 names per list per file. Unparseable files appear with an inline error instead of vanishing. Languages: TS/TSX/JS/JSX/Python; other files are not counted. Use before overview/functions to decide which files matter. 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
pathYesDirectory to map, relative to the server's working directory (or absolute inside it). Use "." for the whole workspace.
Behavior5/5

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

With no annotations, the description carries the full burden and excels: it discloses skipped directories, per-call file caps (200) and per-file name caps (100), truncated behavior, handling of unparseable files with inline errors, supported languages, and the exact return JSON structure. This is exemplary transparency beyond what any structured metadata could provide.

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

Conciseness5/5

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

Though long, every sentence earns its place. It is front-loaded with purpose, then behavior, limits, language support, and usage guidance. No filler or redundancy; dense but well-structured.

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?

Despite having no output schema, the description fully outlines the return JSON shape, fields, and error handling. It also contextualizes the tool among siblings (map before overview/functions, then Read) and provides practical caps. This is complete for a directory-walking tool.

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 description coverage is 100% — the 'path' parameter is already thoroughly described in the schema (relative path, absolute path, '.' for workspace). The description adds no new parameter-specific semantics beyond what the schema provides, so the baseline 3 is appropriate.

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 what the tool does: 'Per-file structural overview of a whole directory tree in one call' — a specific verb-as-noun 'map' applied to a resource (directory tree). It also distinguishes itself from siblings by positioning as 'the orientation tool' and advising use before overview/functions.

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

Usage Guidelines4/5

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

It explicitly says when to use it ('Use before overview/functions to decide which files matter') and provides an alternative strategy when truncated ('map subdirectories individually to go deeper'). It also instructs to Read the actual source after locating code. However, it does not explicitly state when not to use the tool versus alternatives, so it falls short of a 5.

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