Skip to main content
Glama

get_file_content

Read file contents from a GitHub repository at a specified branch, tag, or commit. Retrieves decoded text content for any file path.

Instructions

Read the contents of a file from a GitHub repository at a given ref (branch, tag, or commit SHA). Defaults to the repo's default branch. Text files are returned UTF-8-decoded under 'decoded_content'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNoBranch, tag, or commit SHA (optional)
pathYesFile path within the repo (e.g., 'src/main.py')
repoYesRepository name
ownerYesRepository owner (user or org)
Behavior3/5

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

Without annotations, the description must cover behavioral aspects. It mentions that text files are returned UTF-8-decoded under 'decoded_content', but does not explain behavior for binary files, error handling, or permission requirements. Adequate but not comprehensive.

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?

Two sentences that front-load purpose and provide key details. No unnecessary words; every sentence earns its place.

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?

The description covers main behavior (reading file, ref handling, text file decoding) for a simple read tool. It lacks details on error cases or output format for non-text files, but given 100% schema coverage and no output schema, it is fairly complete.

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%, so the baseline is 3. The description adds value by clarifying that 'ref' is optional and defaults to the default branch, and implies that 'path' is the file path. This slightly enhances understanding beyond schema descriptions.

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 'Read the contents of a file from a GitHub repository', with specific verb and resource. It adds nuance about ref (branch/tag/commit SHA) and default branch behavior, distinguishing it from sibling tools focused on issues, PRs, and search.

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?

The description explains when to provide a ref (branch/tag/commit SHA) and that it defaults to the repo's default branch when omitted. It doesn't explicitly list when not to use, but sibling tools are unrelated, so context is sufficient.

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/AbdeeBuilds/github-mcp'

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