Skip to main content
Glama

function_body

Obtain the verbatim source of one function from a file by providing its path and name, with disambiguation for ambiguous definitions. Returns the function's signature, decorators, and body.

Instructions

Verbatim source of ONE function — the focused read. Instead of Reading a whole file, get exactly that function's source (signature + decorators + body). Returns JSON {path, name, parent, kind, signature, line, endLine, async, exported, hasErrors, body}. name matches the bare or dotted-qualified form from functions/find ('Widget.render'); if ambiguous the call FAILS listing candidates with lines — pass the qualified name or line, 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 (reason about its internals) — but re-Read before editing. Languages: TS/TSX/JS/JSX/Python.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lineNoDisambiguator: the definition line (from functions/find) when a name has several definitions.
nameYesFunction/method name, bare ('render') or dotted ('Widget.render') as reported by functions/find. Default exports are 'default'.
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
Behavior4/5

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

No annotations provided, so description carries full burden. Discloses return format, failure mode on ambiguity, truncation at 20000 chars with truncated.bodyChars indicator, and supported languages. Does not mention auth or rate limits, but for a read-only tool this is sufficient.

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 comprehensive yet efficient. Each sentence adds value. Front-loaded with purpose. Could be slightly more concise but remains readable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, description details output JSON fields. Covers failure modes, truncation, language support, and usage tips. For a focused read tool, it is complete and anticipates common questions.

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 coverage is 100% but descriptions are minimal. Description adds meaning: name can be bare or dotted-qualified, default exports are 'default', path resolution rules, and line as disambiguator. Adds 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 states 'Verbatim source of ONE function — the focused read.' clearly distinguishing from reading entire files. Contrasts with sibling tools like 'functions' and 'find' by emphasizing focused retrieval. Verb+resource+scope is specific and unambiguous.

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?

Explicitly advises using this tool instead of reading a whole file. Mentions ambiguity handling and provides guidance on qualified names or lines. Does not explicitly name alternatives, but context is clear.

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