Skip to main content
Glama

map

Walk a directory recursively to retrieve a JSON overview of code files (with classes and functions) and document outlines, skipping non-source directories.

Instructions

Whole-project surface in ONE call — the orientation tool over a mixed tree of code AND docs. Walks a directory recursively (skipping node_modules, .git, dist, build, venv, pycache, target, vendor, hidden dirs) and returns JSON {path, code:{files[{path, language, totalLines, classes[], functions[], hasErrors?, error?}], totalSupportedFiles, filesParsed, truncated}, docs:{docs[{path, title, headingCount, outlinePreview[], bytes}], totalDocs, truncated}, summary:{codeFiles, docFiles}}. Code files (.ts .tsx .mts .cts .js .jsx .mjs .cjs .py) report structure; doc files (.md .markdown .mdx) report title + shallow outline. Caps: 200 code files and 200 docs per call (truncated flags carry the true totals — map a subtree to go deeper). Unparseable files appear with an inline error, never vanish. Use FIRST to decide which files matter, then the drill-down tools (overview/functions for code, outline/heading for docs). lens is a navigation map over code and docs: use it to LOCATE things, then Read the actual source/section before judging or modifying it. A signature is not the body; an outline is not the section.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesDirectory to map, relative to the 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?

Discloses skipping directories (node_modules, .git, etc.), caps (200 code files and 200 docs), truncated flags, and error handling for unparseable files. No annotations provided, so description carries full burden and does so comprehensively.

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?

Description is dense but well-structured, starting with purpose, then JSON structure, then caps, then usage. Every sentence adds value. Could be slightly more concise but overall efficient.

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?

No output schema exists, so description must explain return values. It details the JSON shape, fields for code and docs, caps, truncated flags, and error handling. It also explains usage context (use maps first). Complete for a complex tool with no output schema.

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

Parameters4/5

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

Schema has one parameter 'path' with basic description. Description adds significant context: use '.' for whole workspace, relative/absolute inside working directory, and implies recursive behavior. Schema coverage is 100%, so baseline is 3, but description adds extra value beyond schema.

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?

Description clearly states it's an orientation tool that maps a directory recursively, returning JSON with code and docs structure. It distinguishes itself from sibling tools (e.g., overview, functions, outline) by positioning itself as the first step to locate files, then using drill-down tools.

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?

Explicitly says 'Use FIRST to decide which files matter, then the drill-down tools (overview/functions for code, outline/heading for docs)' and advises to use it to locate things and then read actual source before judging or modifying. Provides clear when-to-use 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/lens-mcp'

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