Skip to main content
Glama

functions

Retrieve a complete list of all functions in a source file, including nested and class methods, with reconstructed signatures. Use the output to select a line range to read or fetch a single function body.

Instructions

Every addressable function in a source file — nested functions, class methods, getters/setters, class-field arrows, namespace members, object-literal methods, default-export functions — with reconstructed signatures. NOT listed: anonymous callbacks, TS overload signatures (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 ('Widget.render'), null at top level; default exports are named 'default'. Caps at 500 (truncated.functions = true total). Use to pick a line range to Read or read one body with function_body. 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
pathYesFile path. Relative paths resolve against the server's working directory; absolute paths are allowed only inside it (outside is rejected — call info to see the root). Code: .ts .tsx .mts .cts .js .jsx .mjs .cjs .py; docs: .md .markdown .mdx. A single path, or an array of up to 20 paths (array returns {results, summary}).
Behavior4/5

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

No annotations provided; description covers return format, caps at 500, truncation flag, and nature of output. Discloses that signatures are not bodies but omits any side effects (likely none).

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?

Informative but somewhat verbose; front-loaded with main purpose. Could be slightly more concise without losing detail.

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?

Comprehensive coverage of what's included/excluded, return format, usage guidance, and limitations. No output schema but return format is fully described.

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

Parameters5/5

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

Schema already describes path parameter fully; description adds context on relative/absolute resolution, allowed file types, and multiple path support.

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 the tool lists every addressable function in a source file with reconstructed signatures, specifying inclusions and exclusions. It distinguishes itself from siblings like function_body and outline.

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 tells when to use (to locate code before reading) and when not to use (it's not the body). Mentions alternatives like Read and function_body.

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