Skip to main content
Glama

get_file_contents

Fetch files or directories from any GitHub repository. Specify owner, repo, and path to retrieve content directly.

Instructions

Get the contents of a file or directory in a repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
repoYes
ownerYes
branchNoOptional branch name. Defaults to repository default branch.
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It simply states 'Get the contents' without mentioning whether the operation is read-only, whether authentication is required, how directories are returned (e.g., as a list of items), or that file content is typically base64-encoded. The description also omits pagination behavior for directories and error handling for nonexistent paths. This is a significant transparency gap given the absence of annotations.

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

Conciseness5/5

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

The description is a single, clearly written sentence that front-loads the key action and target. Every word earns its place, and there is no redundancy or filler. It is appropriately sized for the tool's simplicity.

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?

With no output schema and no annotations, the description must provide context about return values and behavior. It fails to mention what the response contains (e.g., file content base64-encoded, directory listing as an array), pagination, or error scenarios. The tool can operate on both files and directories, but the description does not communicate these distinct behaviors, leaving the agent under-informed for correct invocation and result interpretation.

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?

Schema description coverage is only 25% (only 'branch' has a description), so the description must compensate. It adds some meaning by indicating that 'path' can refer to a file or directory, but it does not explain the roles of 'owner' and 'repo' beyond the obvious (repository identifiers). It also fails to mention the optional 'branch' parameter or its default behavior. The description provides minimal added value over the bare parameter names, leaving agent with little semantic guidance.

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 uses a specific verb ('get') and resource ('contents of a file or directory in a repository'), making the tool's primary function immediately clear. It also distinguishes itself from sibling tools like get_repository_tree (which returns a tree structure) and get_commit (which returns commit details). The phrase 'file or directory' accurately captures the tool's dual capability, so purpose clarity is strong.

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?

The description implies usage: use this tool to read file or directory contents. However, it provides no explicit guidance on when to choose this over alternatives (e.g., get_repository_tree for folder structure, get_commit for commit history) and offers no exclusions or prerequisites. This leaves usage decisions to the agent's inference, so a middle score is appropriate.

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/shade-solutions/github-mcp-plus'

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