Skip to main content
Glama

get_function_source

Read-onlyIdempotent

Retrieve the full source of a function or method by symbol name, no file path required, so you read only the code you need instead of entire files.

Instructions

Full source of a function or method by name, no path needed: reads the symbol instead of the whole file.

Input Schema

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv4.20.0
    • addedInput schema / properties / function
      Added value: +{
      +  "description": "Alias de `name`. Function or method (e.g. 'MyClass.method').",
      +  "type": "string"
      +}
    • addedInput schema / properties / symbol_name
      Added value: +{
      +  "description": "Alias de `name`. Function or method (e.g. 'MyClass.method').",
      +  "type": "string"
      +}
  2. Addedv4.0.0

TDQS

B3.3/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, non-destructive, closed-world behavior, so safety is covered. The description adds that lookup is symbol-based and path-free, which is useful context, but it omits notable behaviors such as batch mode, caching (force_full), and the level/hints output shaping.

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?

A single tight sentence with the key differentiator front-loaded and zero filler. It is efficient, though almost too terse relative to the tool's 10-parameter surface.

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

Completeness2/5

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

For a tool with 10 optional parameters and no output schema, the description covers only the single-symbol lookup path and never mentions batch mode ('names'), 'level', 'max_lines', or cache bypass. An agent cannot infer these capabilities from the description alone, leaving significant gaps.

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 coverage is 80%, so most parameters are already documented. The description implies that 'name' drives lookup and file_path is unnecessary, but it adds no syntax, format, or relationship details (batch 'names', 'level', 'max_lines') beyond what the schema provides.

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?

States a specific verb+resource (retrieve full source of a function/method) and adds scope ('by name, no path needed'), which distinguishes it from whole-file reads. It does not explicitly differentiate from siblings like get_class_source or get_functions, so it falls short of a 5.

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

Usage Guidelines3/5

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

'reads the symbol instead of the whole file' implies the use case (targeted symbol retrieval vs file-level reading) but names no explicit alternative (e.g. get_class_source, get_functions, read_lines) and gives no when-not guidance. Usage is implied rather than stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.