Skip to main content
Glama
segentic-lab

codelens-mcp

by segentic-lab

functions

List every function, method, getter, setter, and arrow in a file with signatures and line numbers to locate code quickly.

Instructions

Every addressable function in a file — nested functions, class methods, getters/setters, class-field arrows, namespace members, object-literal methods/properties, default-export functions — with reconstructed signatures. NOT listed: anonymous callbacks passed as arguments (they have no name to navigate to), TS overload signature declarations (only implementations), Python lambdas. Returns JSON {path, language, hasErrors, functions[{name, signature, params[{name,type}], returnType, line, endLine, async, exported, kind, parent}]}. kind is function|method|arrow|getter|setter; parent is the enclosing scope, dotted for nesting (e.g. 'Widget.render'), null at top level; default exports are named 'default'. hasErrors:true = syntax errors, items may be missing. Caps at 500 entries (truncated.functions = true total). Languages: TS/TSX/JS/JSX/Python. Use it to pick the right line range to Read, or to survey an API surface. 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 full burden and does so thoroughly. It discloses exclusions (anonymous callbacks, overload declarations, lambdas), error behavior (hasErrors, items may be missing), the 500-entry cap with truncated.functions flag, supported languages, and how parent/kind/default exports are represented. It even warns 'A signature is not the body' — rich behavioral context beyond what schema or annotations 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?

Despite being lengthy, every sentence adds distinct value: purpose, exclusions, return shape, field semantics, edge cases, cap, languages, and usage guidance. It is front-loaded with core functionality, then uses structured labels ('NOT listed', 'Returns', 'kind', 'parent', 'hasErrors', 'Caps') to make scanning easy. No filler or repetition.

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?

For a complex tool with no output schema, the description is remarkably complete. It covers the full return JSON structure, enumerates all field meanings (kind, parent, async, exported), explains error states, caps, language support, and how to use the result. It also contextualizes the relationship with other navigation tools and advises on proper follow-up (Read the actual source). Nothing important is missing.

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% and the path parameter is already fully described in the schema (path type, relative/absolute resolution, array behavior, supported extensions). The main description adds no additional parameter-level details. Per the rubric, this is a baseline 3: the schema does the heavy lifting and the description doesn't need to compensate.

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 opens with a specific verb+resource: 'Every addressable function in a file' and immediately enumerates exactly what is included (nested functions, class methods, getters/setters, etc.) and what is NOT listed (anonymous callbacks, TS overload signatures, Python lambdas). This clearly distinguishes it from sibling tools like map or function_body, which likely serve different navigation purposes.

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 usage guidance is given: 'Use it to pick the right line range to Read, or to survey an API surface.' It also contrasts with another tool ('codelens is a navigation map: use it to LOCATE code, then Read the actual source before judging or modifying it'), providing an alternative and even a warning about not relying on signatures alone.

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