Skip to main content
Glama

get_function_source

Retrieve the full source code of any function from an Industrial Ecology Python package's GitHub repository, optionally at a specific version tag.

Instructions

Find a function in the package's GitHub source code and return its full source, including docstring and signature.

Searches the repository for files containing the function name, then uses Python's ast module to extract the exact function definition. The raw source file is cached locally after the first fetch.

If a version is given, the file is fetched at that GitHub tag. Call list_source_versions(package) first to confirm the version tag exists.

Only returns an error if the version tag does not exist, or if the function was not present in the codebase at that version.

Args: package: Package name as returned by list_packages(). function_name: Exact name of the function or method to retrieve. version: Optional version tag (e.g. 'v2.1.0' or '2.1.0'). Omit to get the current (latest) implementation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
packageYes
versionNo
function_nameYes
Behavior4/5

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

No annotations provided, so description carries full burden. It discloses caching behavior, version tag fetching, and error conditions. However, it does not mention potential rate limits or authentication needed for GitHub access.

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?

Well-structured with clear paragraphs and bullet-like Args list. Front-loaded with purpose. Could be slightly more concise, but every sentence adds value and there is no redundancy.

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?

Despite no output schema, the description outlines the return value ('full source, including docstring and signature') and error conditions. Given the complexity (caching, versioning), it is complete and thorough.

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?

With 0% schema description coverage, the description fully compensates. Each parameter is explained: package as returned by list_packages(), function_name as exact name, version with examples and default. This adds meaning beyond the schema titles.

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's action: 'Find a function ... and return its full source'. It specifies the resource (function source code) and distinguishes from siblings by referencing list_source_versions for version verification.

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 guides when to use the tool and what prerequisites exist: 'call list_source_versions(package) first to confirm the version tag exists'. It also explains when errors are returned, providing clear context.

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/JonasKlimt/ie_mcp'

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