Skip to main content
Glama
segentic-lab

codelens-mcp

by segentic-lab

function_body

Get the exact source of a single function by path and name, avoiding whole-file reads. Returns signature, decorators, and body, with disambiguation for ambiguous names.

Instructions

Verbatim source of ONE function — the focused read. Instead of Reading a whole file to inspect one function, get exactly that function's source (including its signature and decorators). Returns JSON {path, name, parent, kind, signature, line, endLine, async, exported, hasErrors, body}. name matches the bare name or the dotted qualified form from functions/find output (e.g. 'Widget.render'); if the name is ambiguous, the call FAILS listing the candidates with their lines — pass the qualified name or line to pick one, it never guesses. body is real source, capped at 20000 chars (truncated.bodyChars = true length — Read line..endLine for the rest). The body IS the territory for this one function, so you may reason about its internals — but not about its callers/callees, and re-Read before editing (files change). Languages: TS/TSX/JS/JSX/Python.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lineNoDisambiguator: the line number of the wanted definition (from functions/find output), when the same name has several definitions.
nameYesFunction/method name. Bare ('render') or dotted-qualified ('Widget.render') as reported by functions/find. Default exports are named 'default'.
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
Behavior5/5

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

With no annotations, the description fully carries behavioral disclosure. It reveals failure behavior on ambiguous names ('the call FAILS listing the candidates'), truncation at 20000 chars with a truncated flag, that it 'never guesses', and the ephemeral nature of files ('re-Read before editing'). 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 front-loaded with the core function, then progressively adds return format, naming, failure, truncation, and usage guidance. Despite its length, every sentence provides actionable detail with no redundancy, making it highly 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?

For a tool with no output schema, the description compensates by enumerating the JSON fields, supported languages, size caps, and error behavior. It covers all necessary context for an agent to invoke the tool safely and correctly, leaving no critical gaps.

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 covers all parameters with descriptions, so baseline is 3. The description adds value by explaining that name matches functions/find output (dotted-qualified form, default exports named 'default') and that line is a disambiguator when names collide, exceeding the schema's basic definitions.

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 'Verbatim source of ONE function — the focused read' and clarifies it returns exactly that function's source including signature and decorators. It explicitly contrasts with reading a whole file, and the return JSON structure confirms the tool's specific scope.

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 states when to use this tool ('Instead of Reading a whole file to inspect one function') and defines boundaries ('The body IS the territory for this one function... but not about its callers/callees'). It supports disambiguation via functions/find output, but doesn't name a specific alternative for exploring callers/callees, so it just misses a fifth.

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