Skip to main content
Glama
segentic-lab

codelens-mcp

by segentic-lab

find

Locate a function, method, or class by name across a directory, without grepping. Returns file, line, signature, and parent for each definition.

Instructions

Locate a function, method, or class by name across a directory — "where is X defined?" without grepping. Returns JSON {query, path, matches[{file, name, kind, line, signature, parent}], filesScanned, totalSupportedFiles, truncated, skipped?}. kind is function|method|arrow|getter|setter|class. Matching is case-insensitive substring by default; pass exact:true for exact-name match. Files that could not be searched (oversized/unreadable) are listed in skipped with the reason — never silently ignored. Caps: scans up to 300 files, returns up to 100 matches — truncated:true means there may be more (narrow the path or use exact:true). Finds DEFINITIONS only (not call sites — use grep for those). Languages: TS/TSX/JS/JSX/Python. 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
nameYesSymbol name to find (function/method/class). Substring match unless exact:true.
pathNoDirectory (or single file) to search, relative to the server working directory. Default: "." (whole workspace).
exactNoExact, case-sensitive name match instead of case-insensitive substring (default false).
Behavior5/5

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

No annotations are present, so the description carries full burden. It thoroughly discloses the return JSON shape, match kinds, case-insensitive substring default, exact matching option, skipped file handling with reasons, scan/match caps, truncation flag, and supported languages. This is exemplary transparency.

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?

The description is long but extremely dense, with every sentence earning its place. It is front-loaded with the core purpose, then systematically covers output, matching behavior, skipped files, limits, languages, and follow-up guidance. 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?

Given no output schema and no annotations, this description remarkably covers all necessary context: the exact return object, handling of unsearchable files, caps and truncation, languages, positional nuance (definitions vs call sites), and even a caution to read actual source. It is fully self-sufficient for an agent to select and invoke the tool correctly.

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%, so baseline is 3. The schema already explains 'Substring match unless exact:true' and exact as 'case-insensitive substring'. The description adds little beyond restating these rules and the default path, so it does not significantly increase semantic understanding beyond the structured 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?

The description uses a specific verb ('Locate') and resource ('function, method, or class by name across a directory'), immediately clarifying 'where is X defined?'. It also distinguishes itself by stating 'Finds DEFINITIONS only (not call sites — use grep for those)', which separates it from sibling tools like grep or possibly functions.

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?

It explicitly states when to use ('where is X defined?') and when not ('not call sites — use grep for those'), giving an alternative. It also provides operational guidance like narrowing the path or using exact:true, and advises reading the actual source after locating — clearly covering when-to-use vs. alternatives.

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