Skip to main content
Glama

get_function_source

Fetch the source body of a function or method by name, supporting batch retrieval and line limits for efficient code navigation.

Instructions

Fetch a function/method source body.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoFunction or method (e.g. 'MyClass.method').
namesNoBatch mode: list of names (max 10). Returns {name: result} dict. Mutually exclusive with 'name'.
file_pathNo
max_linesNoCap lines (0=all, level=0 only).
levelNo
force_fullNoBypass symbol cache.
hintsNoAppend a one-line get_full_context hint (default true).
projectNoProject name/path (default: active).
Behavior2/5

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

The description lacks any behavioral details such as side effects, authentication requirements, caching behavior, or return format. With no annotations present to fill this gap, the description is insufficient for the agent to understand the tool's full impact or constraints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, which is concise but lacks necessary detail. While it avoids fluff, it is under-specified for a tool with 8 parameters and no annotations, resulting in a marginally adequate structure.

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

Completeness1/5

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

Given the tool's complexity (8 parameters, no annotations, no output schema), the description is far from complete. It does not cover return values, error handling, or parameter interactions, making it inadequate for an agent to use the tool effectively.

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

Parameters2/5

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

Although schema description coverage is 75%, the description does not add any meaning beyond what is already in the schema. It fails to explain parameter semantics like the meaning of 'level' or the effect of 'max_lines' (0=all, level=0 only), leaving the agent with gaps in understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool fetches a function/method source body, with a specific verb and resource. However, it does not explicitly distinguish itself from sibling tools like get_class_source or get_full_context, which also fetch source code but with different scopes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool over alternatives such as get_class_source, get_full_context, or search_codebase. There is no mention of when not to use it or any prerequisites, leaving the agent without context for appropriate invocation.

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/Mibayy/token-savior'

If you have feedback or need assistance with the MCP directory API, please join our Discord server